Skip to content
Snippets Groups Projects
Commit 77cc88f0 authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

fix error logging 404s and other

parent 409ac4c7
No related branches found
No related tags found
No related merge requests found
......@@ -16,13 +16,15 @@ func handleError(ctx *fiber.Ctx, err error) error {
// Status code defaults to 500
code := fiber.StatusInternalServerError
msg := errorfmt.Error(err)
log := logger.GetRequestLogger(ctx)
log.Errorf("%s", errorfmt.Full(err))
rlog := logger.GetRequestLogger(ctx)
if e, ok := err.(*fiber.Error); ok {
code = e.Code
msg = e.Error()
}
if code >= 500 {
rlog.Errorf("%s", errorfmt.Full(err))
}
if ctx.Accepts(fiber.MIMETextHTML, fiber.MIMETextHTMLCharsetUTF8) != "" {
return handleErrorHTML(ctx, code, msg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment