ozzo-routing
ozzo-routing copied to clipboard
HTTPError with StatusBadRequest return a response with 500 Internal Error
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
I'm actually getting 500 Internal Server Error for every routing.NewHTTPError
I return. Did you figure out what was causing this?