lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin (https://gin-gonic.github.io/gin/ ) to AWS Lambda and Amazon API Gateway.
Hi ,
I am trying to create a global error handler using gin's CustomRecovery. From documentation it looks straightforward but its not working as expected.
gin Initialization
//Using New instead of Default to make sure default recovery and Logger dont get used
r := gin.New()
r.Use(DummyMiddleware)
r.GET("/fail", FailHandler)
r.Use(gin.CustomRecovery(MyCustomRecovery))
ginLambda = ginadapter.NewV2(r)
Hi , I am trying to create a global error handler using gin's CustomRecovery. From documentation it looks straightforward but its not working as expected.
gin Initialization
My CustomRecovery is
Fail Handler
Handler
main
I build it and deploy to AWS, but when i call
/fail
url, MyCustomRecovery method never gets called and I get 502 Error without any body.Not sure what i am doing wrong or its a bug. Any help will be appreciated, already spent 2 days looking into it.