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:
@ -174,7 +174,7 @@ func (d *Director) RequestTransformer() proxy.RequestTransformer {
|
||||
return
|
||||
}
|
||||
|
||||
logger.Error(ctx, "could not retrieve layers from context", logger.E(errors.WithStack(err)))
|
||||
logger.Error(ctx, "could not retrieve layers from context", logger.CapturedE(errors.WithStack(err)))
|
||||
|
||||
return
|
||||
}
|
||||
@ -226,7 +226,7 @@ func (d *Director) Middleware() proxy.Middleware {
|
||||
fn := func(w http.ResponseWriter, r *http.Request) {
|
||||
r, err := d.rewriteRequest(r)
|
||||
if err != nil {
|
||||
logger.Error(r.Context(), "could not rewrite request", logger.E(errors.WithStack(err)))
|
||||
logger.Error(r.Context(), "could not rewrite request", logger.CapturedE(errors.WithStack(err)))
|
||||
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
|
||||
|
||||
return
|
||||
@ -240,7 +240,7 @@ func (d *Director) Middleware() proxy.Middleware {
|
||||
return
|
||||
}
|
||||
|
||||
logger.Error(ctx, "could not retrieve proxy and layers from context", logger.E(errors.WithStack(err)))
|
||||
logger.Error(ctx, "could not retrieve proxy and layers from context", logger.CapturedE(errors.WithStack(err)))
|
||||
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
|
||||
|
||||
return
|
||||
|
Reference in New Issue
Block a user