feat: capture logged errors and forward them to sentry when enabled
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
This commit is contained in:
@ -70,7 +70,7 @@ func assertRequestUser(w http.ResponseWriter, r *http.Request) (auth.User, bool)
|
||||
ctx := r.Context()
|
||||
user, err := auth.CtxUser(ctx)
|
||||
if err != nil {
|
||||
logger.Error(ctx, "could not retrieve user", logger.E(errors.WithStack(err)))
|
||||
logger.Error(ctx, "could not retrieve user", logger.CapturedE(errors.WithStack(err)))
|
||||
|
||||
forbidden(w, r)
|
||||
|
||||
|
@ -35,5 +35,5 @@ func invalidDataErrorResponse(w http.ResponseWriter, r *http.Request, err *schem
|
||||
|
||||
func logAndCaptureError(ctx context.Context, message string, err error) {
|
||||
sentry.CaptureException(err)
|
||||
logger.Error(ctx, message, logger.E(err))
|
||||
logger.Error(ctx, message, logger.CapturedE(err))
|
||||
}
|
||||
|
Reference in New Issue
Block a user