Skip to content

Commit 4bdcbca

Browse files
committed
catch the Exception error
1 parent 5e42947 commit 4bdcbca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/PHPErrors.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ public function handleException(\Throwable $exception)
9898
$exception = new \ErrorException($exception->getMessage(), 0, E_ERROR, $exception->getFile(), $exception->getLine());
9999
}
100100

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

104104
if ($type & self::$reportLevel) {
105105
$message = $this->formatMessage(
106-
$exception->getMessage(),
106+
$exception->getTraceAsString(),
107107
$exception->getFile(),
108108
$exception->getLine()
109109
);

0 commit comments

Comments
 (0)