// Create a new fiber instance with custom config
app := fiber.New(fiber.Config{
// Override default error handler
ErrorHandler: func(ctx *fiber.Ctx, err error) error {
// Status code defaults to 500
code := fiber.StatusInternalServerError
// Retrieve the custom status code if it's an fiber.*Error
if e, ok := err.(*fiber.Error); ok {
// Send custom error page
err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))
// In case the SendFile fails
return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")