Prevent duplicate error responses.
This commit is contained in:
parent
58e75cf7a6
commit
bbf27d1b04
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue