← All changes
|
vendor_prefixed/sentry/sentry/src/Logs/LogsAggregator.php
+6
-1
1.10.12
→
1.10.21
View file →
| @@ -91,9 +91,14 @@ | ||
| 91 | 91 | continue; |
| 92 | 92 | } |
| 93 | 93 | $log->setAttribute($key, $attribute); |
| 94 | 94 | } |
| 95 | - $log = $options->getBeforeSendLogCallback()($log); | |
| 95 | + try { | |
| 96 | + $log = $options->getBeforeSendLogCallback()($log); | |
| 97 | + } catch (\Throwable $exception) { | |
| 98 | + $options->getLoggerOrNullLogger()->error(\sprintf('The "before_send_log" callback failed with exception: "%s".', $exception->getMessage())); | |
| 99 | + return; | |
| 100 | + } | |
| 96 | 101 | if ($log === null) { |
| 97 | 102 | if ($sdkLogger !== null) { |
| 98 | 103 | $sdkLogger->info('Log will be discarded because the "before_send_log" callback returned "null".', ['log' => $log]); |
| 99 | 104 | } |