Skip to content

Commit

Permalink
Log error message to stdout if poller panics
Browse files Browse the repository at this point in the history
otherwise we only see the error message if we're using sentry.
  • Loading branch information
David Robertson committed Jul 10, 2023
1 parent 41a7240 commit 5064f64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sync2/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ func (p *poller) Poll(since string) {
defer func() {
panicErr := recover()
if panicErr != nil {
logger.Error().Str("user", p.userID).Str("device", p.deviceID).Msg(string(debug.Stack()))
logger.Error().Str("user", p.userID).Str("device", p.deviceID).Msgf("%s. Traceback:\n%s", panicErr, debug.Stack())
internal.GetSentryHubFromContextOrDefault(ctx).RecoverWithContext(ctx, panicErr)
}
p.receiver.OnTerminated(ctx, p.userID, p.deviceID)
Expand Down

0 comments on commit 5064f64

Please sign in to comment.