luraproject / lura

Ultra performant API Gateway with middlewares. A project hosted at The Linux Foundation

Home Page:https://luraproject.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regression introduced in Gin HandlerFactory by 9b38da3

mzanibelli opened this issue · comments

Describe the bug
The error returned by an endpoint is not included into the Gin context anymore.

To Reproduce
Steps to reproduce the behavior:

  1. Configuration used: gin-based routing
  2. Steps to run the software: call an endpoint that fails (timeout, ...)

Expected behavior
We can access the error message in a custom Gin log formatter passed to NewEngine, from gin.LogFormatterParams.

Logs
N/A.

Additional context

It seems to be this line exactly that removes the error from the Gin context. It's really annoying when using a custom access log formatter that includes info about the request: we're supposed to have the reason of the failure in gin.LogFormatterParams.ErrorMessage to correlate it.
Instead, we're forced to use the logging.Logger passed to CustomErrorEndpointHandler which does not include info about the request.

This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.