fix(GODT-2390): Add reports for uncaught json and net.opErr

Report to sentry if we see some uncaught network err, but don't force
the user logout.

If we catch an uncaught json parser error we report the error to sentry
and let the user be logged out later.

Finally this patch also prints the error type in UserBadEvent sentry
report to further help diagnose issues.
This commit is contained in:
Leander Beernaert
2023-02-22 13:30:45 +01:00
parent 065dcd4d47
commit 3e878058e7
3 changed files with 45 additions and 1 deletions

View File

@ -179,3 +179,14 @@ type IMAPLoginFailed struct {
func (event IMAPLoginFailed) String() string {
return fmt.Sprintf("IMAPLoginFailed: Username: %s", event.Username)
}
type UncategorizedEventError struct {
eventBase
UserID string
Error error
}
func (event UncategorizedEventError) String() string {
return fmt.Sprintf("UncategorizedEventError: UserID: %s, Source:%T, Error: %s", event.UserID, event.Error, event.Error)
}