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 the API layer of my app, Every call can return HTTPError with various Status.
For exemple in case of a no found objet for a GET call I return : return routing.NewHTTPError(http.StatusNotFound, err.Error())
The response head will be correctly set.
But when I use the http.StatusBadRequest in the exact same way (for example a POST with invalid validation):
Hello,
In the API layer of my app, Every call can return HTTPError with various Status.
For exemple in case of a no found objet for a GET call I return :
return routing.NewHTTPError(http.StatusNotFound, err.Error())
The response head will be correctly set.
But when I use the http.StatusBadRequest in the exact same way (for example a POST with invalid validation):
return routing.NewHTTPError(http.StatusBadRequest)
The response header is set to 500 Internal Server Error instead of 400 Bad request.
Thanks,
Regards,
Arthur
The text was updated successfully, but these errors were encountered: