|
get_class($exception), |
|
$exception->getMessage(), |
|
$exception->getTraceAsString() |
|
); |
|
trigger_error($message, E_USER_ERROR); |
|
} |
|
|
|
/** |
|
* Method that can be easily stubbed in testing. |
|
$this->_handled = true; |
|
[$error, $log] = static::mapErrorCode($code); |
|
if ($log === LOG_ERR) { |
|
/** @psalm-suppress PossiblyNullArgument */ |
|
return $this->handleFatalError($code, $description, $file, $line); |
|
} |
|
$data = [ |
|
'level' => $log, |
|
'code' => $code, |
|
get_class($exception), |
|
$exception->getMessage(), |
|
$exception->getTraceAsString() |
|
); |
|
trigger_error($message, E_USER_ERROR); |
|
} |
|
|
|
/** |
|
* Method that can be easily stubbed in testing. |
|
); |
|
$response = $renderer->render(); |
|
$this->_sendResponse($response); |
|
} catch (Throwable $exception) { |
|
$this->_logInternalError($exception); |
|
} |
|
} |
|
|
|
/** |
|
* @see https://secure.php.net/manual/en/function.set-exception-handler.php |
|
*/ |
|
public function handleException(Throwable $exception): void |
|
{ |
|
$this->_displayException($exception); |
|
$this->logException($exception); |
|
$code = $exception->getCode() ?: 1; |
|
$this->_stop((int)$code); |
|
} |
If you want to customize this error message, create
templates/Error/error500.php