Przeglądaj źródła

Add support for PHP 7 errors in RavenHandler by checking for Throwable instead of Exception

Jared King 9 lat temu
rodzic
commit
bc3ccb0e87
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/Monolog/Handler/RavenHandler.php

+ 1 - 1
src/Monolog/Handler/RavenHandler.php

@@ -179,7 +179,7 @@ class RavenHandler extends AbstractProcessingHandler
             $options['release'] = $this->release;
             $options['release'] = $this->release;
         }
         }
 
 
-        if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) {
+        if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) {
             $options['extra']['message'] = $record['formatted'];
             $options['extra']['message'] = $record['formatted'];
             $this->ravenClient->captureException($record['context']['exception'], $options);
             $this->ravenClient->captureException($record['context']['exception'], $options);
         } else {
         } else {