sentry-rust icon indicating copy to clipboard operation
sentry-rust copied to clipboard

Better handling of HTTP failures

Open Diggsey opened this issue 4 months ago • 2 comments

Problem Statement

If sentry fails to send an event (which totally hypothetically might happen if reqwest can't find CA certificates because someone added a dependency which forgot to disable reqwest's default features, and now native-tls is used instead of rustls, and native-tls doesn't know about the embedded webpki roots...) then this error is only logged with sentry_debug!, ie. it's essentially dropped, so errors go completely unnoticed.

Solution Brainstorm

This kind of error should be treated more seriously. There should be an "error fallback" for when errors cannot be reported to sentry. By default this should write the error to stderr, but it might be useful if a custom handler could be provided when the Client is created.

Diggsey avatar Aug 06 '25 13:08 Diggsey

Thank you @Diggsey for the suggestion. This is partially related to https://github.com/getsentry/sentry-rust/issues/713 and https://github.com/getsentry/sentry-rust/issues/482 and we should take those into account when thinking about implementing this.

lcian avatar Aug 07 '25 09:08 lcian