mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-24 06:04:25 +00:00
533 B
533 B
Recover
Recover middleware recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.
Example
package main
import (
"github.com/gofiber/fiber"
"github.com/gofiber/fiber/middleware"
)
func main() {
app := fiber.New()
app.Use(middleware.Recover())
app.Get("/", func(c *fiber.Ctx) {
panic("normally this would crash your app")
})
app.Listen(3000)
}
Signatures
func Recover() fiber.Handler {}