We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request.error
Considering that Pyramid HTTPExceptions inherit from Response and Exception I can raise or return such objects. However, I was wondering how that plays along with Cornice’s request.errors dictionary.
Response
Exception
request.errors
What’s the recommended way of filling that errors dictionary and then raising an HTTP error response—if that’s doable at all?
errors
Something like
request.errors.add("body", "foo", "Invalid foo specified.") request.errors.status = 404 # Not found raise HTTPNotFound()
creates a new Response and the errors dictionary isn’t being used, correct?
The text was updated successfully, but these errors were encountered:
Addendum Should have tried before I asked. That’s exactly how it works, actually.
@leplatrem, mind if I expand on the documentation a bit? This is quite a handy detail. Or did I miss it somewhere?
Sorry, something went wrong.
@jenstroeger Of course! please do!
@leplatrem, done with this PR.
No branches or pull requests
Considering that Pyramid HTTPExceptions inherit from
Response
andException
I can raise or return such objects. However, I was wondering how that plays along with Cornice’srequest.errors
dictionary.What’s the recommended way of filling that
errors
dictionary and then raising an HTTP error response—if that’s doable at all?Something like
creates a new
Response
and theerrors
dictionary isn’t being used, correct?The text was updated successfully, but these errors were encountered: