-
-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Catch all exceptions thrown while sending an event #899
Conversation
Co-Authored-By: Alessandro Lai <alessandro.lai85@gmail.com>
Hey folks. From my perspective of being an author of a custom sentry integration, this change is a breaking change. In the integration I have code like this: try {
$hub->captureEvent($payload);
} catch (\Throwable $e) {
// Avoid hard failure in case connection to sentry failed
if ($this->fallbackWriter) {
$this->fallbackWriter->writeLog(
new LogRecord(
'Sentry.Writer',
LogLevel::ERROR,
'Failed to write to Sentry',
['exception' => $e],
$record->getRequestId()
)
);
}
} It means that I rely on the exception being throw to be able to handle that case and use a fallback strategy to capture the event, to make sure it is not silently discarded. With this change, there is no way to detect such failure, except of course, by implementing my own HttpTransport. Any thoughts? |
Technically speaking I think that we can consider this a BC indeed... However, please note that before |
@ste93cry You are right, thanks. I missed that my code actually never did what I expected, as requests have been sent on shutdown only before 2.2.0. So In fact, there is no change in behavior here and I'm now onto implementing my own HttpTransport to be able to have a fallback feature in my integration. Thanks again for the quick response! |
This fixes an issue if Sentry replies with
429
error code that we no longer throw an exception.