Prevent duplicate error responses.
This commit is contained in:
parent
58e75cf7a6
commit
bbf27d1b04
@ -11,6 +11,10 @@ type Error struct {
|
||||
}
|
||||
|
||||
func (e *Error) Get(err error, c echo.Context) {
|
||||
if c.Response().Committed {
|
||||
return
|
||||
}
|
||||
|
||||
code := http.StatusInternalServerError
|
||||
if he, ok := err.(*echo.HTTPError); ok {
|
||||
code = he.Code
|
||||
|
Loading…
Reference in New Issue
Block a user