Skip to content

Commit

Permalink
fix: Repair error handler
Browse files Browse the repository at this point in the history
Was attempting to send an empty error if one wasn't returned by the
original function. Repairs error handler to send the inner error's
message regardless.
  • Loading branch information
Muirrum committed Oct 25, 2023
1 parent 2692989 commit a84c790
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ func main() {
var e *fiber.Error
if errors.As(err, &e) {
code = e.Code
} else {
e.Code = code
}

e.Message = err.Error()

// Send custom error page
return c.Status(code).SendString(e.Message)

Expand Down

0 comments on commit a84c790

Please sign in to comment.