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
committed by James Houlahan
parent 82c388a0dd
commit dcf694588c
3 changed files with 43 additions and 5 deletions

View File

@ -156,3 +156,14 @@ type AddressModeChanged struct {
func (event AddressModeChanged) String() string {
return fmt.Sprintf("AddressModeChanged: UserID: %s, AddressMode: %s", event.UserID, event.AddressMode)
}
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)
}