diff options
Diffstat (limited to 'lib/private/Log.php')
-rw-r--r-- | lib/private/Log.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Log.php b/lib/private/Log.php index 6ccf467dc8a..0415967f0f0 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -308,7 +308,13 @@ class Log implements ILogger, IDataLogger { $app = $context['app'] ?? 'no app in context'; $level = $context['level'] ?? ILogger::ERROR; - $serializer = new ExceptionSerializer($this->config); + // if an error is raised before the autoloader is properly setup, we can't serialize exceptions + try { + $serializer = new ExceptionSerializer($this->config); + } catch (\Throwable $e) { + $this->error("Failed to load ExceptionSerializer serializer while trying to log " . $exception->getMessage()); + return; + } $data = $serializer->serializeException($exception); $data['CustomMessage'] = $this->interpolateMessage($context, $context['message'] ?? '--'); |