diff --git a/main.go b/main.go index b33eb9e..4b6b3df 100644 --- a/main.go +++ b/main.go @@ -25,9 +25,10 @@ func main() { code := fiber.StatusInternalServerError // Retrieve the custom status code if it's a *fiber.Error - var e *fiber.Error - if errors.As(err, &e) { - code = e.Code + var tmp *fiber.Error + e := fiber.Error{} + if errors.As(err, &tmp) { + code = tmp.Code } else { e.Code = code }