aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-03-15 14:32:50 +0000
committerGitHub <noreply@github.com>2022-03-15 14:32:50 +0000
commit6c01863d392e01651fb7d517083ce36f47ade91f (patch)
tree39f7aac4a8adda49d0d02d98f659415a193a789f /lib
parent04a4562a01e3594797ff4179769f3f9a45c3d9d2 (diff)
parent74f64fa3eba96c232b71af21ef0fd0b97e0ebf56 (diff)
downloadnextcloud-server-6c01863d392e01651fb7d517083ce36f47ade91f.tar.gz
nextcloud-server-6c01863d392e01651fb7d517083ce36f47ade91f.zip
Merge pull request #31573 from nextcloud/exceptionserializer-load-fail
don't error if we can't load the ExceptionSerializer for early exceptions
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Log.php8
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'] ?? '--');