Skip to content

Commit

Permalink
actually finally fix error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Muirrum committed Oct 25, 2023
1 parent a84c790 commit 779129e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 779129e

Please sign in to comment.