You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RequestLogger: "error":"renderer not registered"
HTTPErrorHandler : err = nil
{"time":"2026-01-20T12:03:34.7921301+08:00","level":"ERROR","msg":"REQUEST_ERROR","method":"GET","uri":"/error","status":200,"latency":0,"host":"localhost:1323","bytes_in":"","bytes_out":5,"user_agent":"curl/8.16.0","remote_ip":"::1","request_id":"","error":"renderer not registered"}
2026/01/20 12:03:34 INFO err err=<nil>
You probably solved it yourself but resp, err := echo.UnwrapResponse(c.Response()) shadows the function argument err variable. Better way to do it would be to this
Yes, this is a small issue that is easy to overlook.
In version V4, resp, err := echo.UnwrapResponse(c.Response()) is not needed, and err will not be overwritten.
I am upgrading from version V4 to version V5.
In V4, Recover provides a dedicated handler with the type type LogErrorFunc func(c echo.Context, err error, stack []byte) error,
allowing panic handling and stack retrieval to be done independently.
In V5, this no longer exists; everything is handled through HTTPErrorHandler func(c echo.Context, err error).
Since the panic is wrapped using fmt.Errorf("[PANIC RECOVER] %w %s", tmpErr, stack[:length]),
it is currently not convenient to determine whether an error is caused by a panic, nor to reliably extract the stack trace.
@aldas Is there any good recommendation or solution for this.
@zuozhehao I have merged #2871. I'll tag new patch release in couple of days but you can use it if you add direct commit as dependency. go get -u github.com/labstack/echo/v5@096ce41d2a24f5ec652b21adbcf25c484bef49ea
Activity
[-]V5 Response committed no effect[/-][+]V5 HTTPErrorHandler unable capture error[/+][-]V5 HTTPErrorHandler unable capture error[/-][+]V5 unable capture error[/+]aldas commentedon Jan 20, 2026
You probably solved it yourself but
resp, err := echo.UnwrapResponse(c.Response())shadows the function argumenterrvariable. Better way to do it would be to thisDefault error handler is implemented like that:
echo/echo.go
Lines 365 to 413 in 9500f27
and
_ = c.JSON(http.StatusOK, nil)would output{}to the client. so this probably should bezuozhehao commentedon Jan 20, 2026
Yes, this is a small issue that is easy to overlook.
In version V4, resp, err := echo.UnwrapResponse(c.Response()) is not needed, and err will not be overwritten.
I am upgrading from version V4 to version V5.
aldas commentedon Jan 20, 2026
I have note about it to the release notes.
@zuozhehao , what was the most complex part and what most timeconsuming when upgrading from
v4tov5?zuozhehao commentedon Jan 20, 2026
@aldas According to the upgrade documentation, the upgrade was completed quickly, and all features worked normally during gray (canary) testing.
zuozhehao commentedon Jan 20, 2026
In V4, Recover provides a dedicated handler with the type
type LogErrorFunc func(c echo.Context, err error, stack []byte) error,allowing panic handling and stack retrieval to be done independently.
In V5, this no longer exists; everything is handled through HTTPErrorHandler
func(c echo.Context, err error).Since the panic is wrapped using
fmt.Errorf("[PANIC RECOVER] %w %s", tmpErr, stack[:length]),it is currently not convenient to determine whether an error is caused by a panic, nor to reliably extract the stack trace.
@aldas Is there any good recommendation or solution for this.
aldas commentedon Jan 20, 2026
Are you just logging that stack? I think we can bring that handler function back.
zuozhehao commentedon Jan 20, 2026
@aldas Yes, at the moment it is not possible to accurately identify the error type within HTTPErrorHandler.
If we change tmpErr to a custom error type, such as PanicError, would that be an appropriate approach.
echo/middleware/recover.go
Lines 78 to 80 in 9500f27
aldas commentedon Jan 20, 2026
@zuozhehao I have merged #2871. I'll tag new patch release in couple of days but you can use it if you add direct commit as dependency.
go get -u github.com/labstack/echo/v5@096ce41d2a24f5ec652b21adbcf25c484bef49ea