public function exceptionHandler(Throwable
$exception) { $this->exceptionCaughtByExceptionHandler =
$exception;
[$statusCode,
$exitCode] =
$this->
determineCodes($exception);
if ($this->config->log === true && !
in_array($statusCode,
$this->config->ignoreCodes, true
)) { log_message('critical', "{message}\nin {exFile} on line {exLine}.\n{trace}",
[ 'message' =>
$exception->
getMessage(),
'exFile' =>
clean_path($exception->
getFile()), // {file} refers to THIS file
'exLine' =>
$exception->
getLine(), // {line} refers to THIS line
'trace' => self::
renderBacktrace($exception->
getTrace()),
]);
} $this->request = Services::
request();
$this->response = Services::
response();
// Get the first exception.
while ($prevException =
$exception->
getPrevious()) { $exception =
$prevException;
}