From bde8806a52e2846584b2461ba3db8a91bcaeb0c3 Mon Sep 17 00:00:00 2001 From: divyam234 <47589864+divyam234@users.noreply.github.com> Date: Tue, 4 Jun 2024 12:58:32 +0530 Subject: [PATCH] chore: Add gin recovery middleware for error handling --- cmd/run.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/run.go b/cmd/run.go index 0a5fa94..e75a0eb 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -210,6 +210,8 @@ func initApp(lc fx.Lifecycle, cfg *config.Config, c *controller.Controller) *gin r := gin.New() + r.Use(gin.Recovery()) + r.Use(ginzap.GinzapWithConfig(logging.DefaultLogger().Desugar(), &ginzap.Config{ TimeFormat: time.RFC3339, UTC: true,