feat:panic recover

This commit is contained in:
Rama Priyanto 2025-12-30 07:59:35 +07:00
parent 07ebbdbe1b
commit 2917d38e59
1 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import (
"github.com/go-co-op/gocron"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
futils "github.com/gofiber/fiber/v2/utils"
"github.com/rs/zerolog"
"go.uber.org/fx"
@ -37,6 +38,11 @@ func NewFiber(cfg *config.Config) *fiber.App {
DisableStartupMessage: true,
ReadBufferSize: 8192,
})
// ==============================
app.Use(recover.New(recover.Config{
EnableStackTrace: true,
}))
// pass production config to check it
response.IsProduction = cfg.App.Production