Skip to content

Commit

Permalink
catch the Exception error
Browse files Browse the repository at this point in the history
  • Loading branch information
Kooooooma committed Jun 1, 2017
1 parent 5e42947 commit 4bdcbca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PHPErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ public function handleException(\Throwable $exception)
$exception = new \ErrorException($exception->getMessage(), 0, E_ERROR, $exception->getFile(), $exception->getLine());
}

if ($exception instanceof \ErrorException) {
$type = $exception->getSeverity();
if ($exception instanceof \ErrorException || $exception instanceof \Exception) {
$type = $exception instanceof \ErrorException ? $exception->getSeverity() : E_ERROR;

if ($type & self::$reportLevel) {
$message = $this->formatMessage(
$exception->getMessage(),
$exception->getTraceAsString(),
$exception->getFile(),
$exception->getLine()
);
Expand Down

0 comments on commit 4bdcbca

Please sign in to comment.