mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-12 02:12:15 +01:00
improving logging
This commit is contained in:
@@ -30,8 +30,7 @@ func Context(config *config.Config) echo.MiddlewareFunc {
|
||||
// if the endpoint is not for healthcheck, associate a
|
||||
// resource to our custom context.
|
||||
if err := ctx.WithResource(trace); err != nil {
|
||||
// required to have a correct status code
|
||||
// in the logs.
|
||||
// required to have a correct status code.
|
||||
ctx.Error(err)
|
||||
return ctx.LogRequestResult(err, false)
|
||||
}
|
||||
|
||||
@@ -35,8 +35,7 @@ func Error() echo.MiddlewareFunc {
|
||||
default:
|
||||
httpErr = echo.NewHTTPError(http.StatusInternalServerError, errMessage)
|
||||
}
|
||||
// required to have a correct status code
|
||||
// in the logs.
|
||||
// required to have a correct status code.
|
||||
ctx.Error(httpErr)
|
||||
return httpErr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user