mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-23 17:23:51 +00:00
599 B
599 B
Recover
Recover middleware recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.
Example
Import the middleware package that is part of the Fiber web framework
import (
"github.com/gofiber/fiber"
"github.com/gofiber/fiber/middleware"
)
After you initiate your Fiber app, you can use the following possibilities:
func main() {
app := fiber.New()
// Default recover
app.Use(middleware.Recover())
// ...
}
Signatures
func Recover() fiber.Handler {}