summaryrefslogtreecommitdiffstats
path: root/src/Monolog/Handler/PHPConsoleHandler.php
diff options
context:
space:
mode:
authorJordi Boggiano <j.boggiano@seld.be>2017-03-20 10:14:03 +0100
committerJordi Boggiano <j.boggiano@seld.be>2017-03-20 10:14:03 +0100
commit5e3be010d0e51d8b1118617f9527c3261684a2a7 (patch)
tree3b82aafd6db539a9c9e53342c505f55bf5cea1ba /src/Monolog/Handler/PHPConsoleHandler.php
parentb9256e99b6c2634b75c9cbfe2c192f590ee5a33f (diff)
downloadmonolog-5e3be010d0e51d8b1118617f9527c3261684a2a7.zip
monolog-5e3be010d0e51d8b1118617f9527c3261684a2a7.tar.gz
monolog-5e3be010d0e51d8b1118617f9527c3261684a2a7.tar.bz2
Make sure we use \Throwable and not just \Exception
Diffstat (limited to 'src/Monolog/Handler/PHPConsoleHandler.php')
-rw-r--r--src/Monolog/Handler/PHPConsoleHandler.php9
1 files changed, 4 insertions, 5 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);