summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Monolog/Handler/PHPConsoleHandler.php9
-rw-r--r--src/Monolog/Handler/RavenHandler.php2
-rw-r--r--src/Monolog/Handler/RollbarHandler.php4
3 files changed, 7 insertions, 8 deletions
diff --git a/src/Monolog/Handler/PHPConsoleHandler.php b/src/Monolog/Handler/PHPConsoleHandler.php
index 511bf4e..0bc16ee 100644
--- a/src/Monolog/Handler/PHPConsoleHandler.php
+++ b/src/Monolog/Handler/PHPConsoleHandler.php
@@ -11,7 +11,6 @@
namespace Monolog\Handler;
-use Exception;
use Monolog\Formatter\LineFormatter;
use Monolog\Formatter\FormatterInterface;
use Monolog\Logger;
@@ -71,12 +70,12 @@ class PHPConsoleHandler extends AbstractProcessingHandler
* @param Connector|null $connector Instance of \PhpConsole\Connector class (optional)
* @param int $level
* @param bool $bubble
- * @throws Exception
+ * @throws RuntimeException
*/
public function __construct(array $options = [], Connector $connector = null, $level = Logger::DEBUG, $bubble = true)
{
if (!class_exists('PhpConsole\Connector')) {
- throw new Exception('PHP Console library not found. See https://github.com/barbushin/php-console#installation');
+ throw new \RuntimeException('PHP Console library not found. See https://github.com/barbushin/php-console#installation');
}
parent::__construct($level, $bubble);
$this->options = $this->initOptions($options);
@@ -87,7 +86,7 @@ class PHPConsoleHandler extends AbstractProcessingHandler
{
$wrongOptions = array_diff(array_keys($options), array_keys($this->options));
if ($wrongOptions) {
- throw new Exception('Unknown options: ' . implode(', ', $wrongOptions));
+ throw new \RuntimeException('Unknown options: ' . implode(', ', $wrongOptions));
}
return array_replace($this->options, $options);
@@ -177,7 +176,7 @@ class PHPConsoleHandler extends AbstractProcessingHandler
{
if ($record['level'] < Logger::NOTICE) {
$this->handleDebugRecord($record);
- } elseif (isset($record['context']['exception']) && $record['context']['exception'] instanceof Exception) {
+ } elseif (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) {
$this->handleExceptionRecord($record);
} else {
$this->handleErrorRecord($record);
diff --git a/src/Monolog/Handler/RavenHandler.php b/src/Monolog/Handler/RavenHandler.php
index 100866b..045f236 100644
--- a/src/Monolog/Handler/RavenHandler.php
+++ b/src/Monolog/Handler/RavenHandler.php
@@ -180,7 +180,7 @@ class RavenHandler extends AbstractProcessingHandler
$options['release'] = $this->release;
}
- if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) {
+ if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) {
$options['extra']['message'] = $record['formatted'];
$this->ravenClient->captureException($record['context']['exception'], $options);
} else {
diff --git a/src/Monolog/Handler/RollbarHandler.php b/src/Monolog/Handler/RollbarHandler.php
index 8525bbe..5b6678e 100644
--- a/src/Monolog/Handler/RollbarHandler.php
+++ b/src/Monolog/Handler/RollbarHandler.php
@@ -12,7 +12,7 @@
namespace Monolog\Handler;
use RollbarNotifier;
-use Exception;
+use Throwable;
use Monolog\Logger;
/**
@@ -96,7 +96,7 @@ class RollbarHandler extends AbstractProcessingHandler
'datetime' => $record['datetime']->format('U'),
]);
- if (isset($context['exception']) && $context['exception'] instanceof Exception) {
+ if (isset($context['exception']) && $context['exception'] instanceof Throwable) {
$payload['level'] = $context['level'];
$exception = $context['exception'];
unset($context['exception']);