Skip to content

Commit

Permalink
improve error handling for net error(s)
Browse files Browse the repository at this point in the history
fixes: reverse proxy support #2419
  • Loading branch information
ReneWerner87 committed Apr 20, 2023
1 parent e5c0aef commit f0d678d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/guide/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ Fiber provides an error handler by default. For a standard error, the response i
```go title="Example"
// Default error handler
var DefaultErrorHandler = func(c *fiber.Ctx, err error) error {
// Handle internal network errors
var netError net.Error
if errors.As(err, &netError) {
// 502 - Bad Gateway
err = ErrBadGateway
}
// Status code defaults to 500
code := fiber.StatusInternalServerError

Expand Down

0 comments on commit f0d678d

Please sign in to comment.