[Debug] Wrap call to ->log in a try catch block

If something goes wrong in the logger, the application ends up
with a blank page. Let's display the original exception.
This commit is contained in:
Grégoire Pineau 2016-12-27 15:47:08 +01:00
parent ee69018bf4
commit 18dfef1e2b
1 changed files with 5 additions and 1 deletions

View File

@ -504,7 +504,11 @@ class ErrorHandler
}
}
if ($this->loggedErrors & $type) {
$this->loggers[$type][0]->log($this->loggers[$type][1], $message, $e);
try {
$this->loggers[$type][0]->log($this->loggers[$type][1], $message, $e);
} catch (\Exception $handlerException) {
} catch (\Throwable $handlerException) {
}
}
if ($exception instanceof FatalErrorException && !$exception instanceof OutOfMemoryException && $error) {
foreach ($this->getFatalErrorHandlers() as $handler) {