Handle context cancellations and avoid logged errors.
This commit is contained in:
parent
0f7da0864e
commit
acd38c8205
8 changed files with 83 additions and 35 deletions
|
|
@ -32,6 +32,9 @@ func LoadUser(orm *ent.Client) echo.MiddlewareFunc {
|
|||
case *ent.NotFoundError:
|
||||
return echo.NewHTTPError(http.StatusNotFound)
|
||||
default:
|
||||
if context.IsCanceledError(err) {
|
||||
return nil
|
||||
}
|
||||
c.Logger().Error(err)
|
||||
return echo.NewHTTPError(http.StatusInternalServerError)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue