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
In my project we have our own global error handler that produce a custom http response, but we noticed that the output in the http response was printed 2 times because of this call:
A side-effect of calling global error handler is that now Response has been committed (sent to the client) and middlewares up in chain can not change Response status code or Response body anymore.
Avoid using this method in handlers as no middleware will be able to effectively handle errors after that.
So would it make sense to just remove this call from this middleware? And perhaps instead just return the err in the end of this function? As the purpose of this library isn't to handle the error, just to log it?
The text was updated successfully, but these errors were encountered:
philipjoh
changed the title
Error handling interferce with our own custom error handler
Error handling interferce with other Error handling middleware
Jun 10, 2024
philipjoh
changed the title
Error handling interferce with other Error handling middleware
Error handling interfere with other Error handling middleware
Jun 10, 2024
Hello!
In my project we have our own global error handler that produce a custom http response, but we noticed that the output in the http response was printed 2 times because of this call:
slog-echo/middleware.go
Line 130 in 1205207
Reading the doc of the Error function says:
So would it make sense to just remove this call from this middleware? And perhaps instead just return the err in the end of this function? As the purpose of this library isn't to handle the error, just to log it?
The text was updated successfully, but these errors were encountered: