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