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
Hi
I am writing a REST API using cornice. This is my code:
from pyramid.httpexceptions import HTTPBadRequest @my_service.get( permission="my_permission", validators=(my_validator), ) def my_service(request): # My code request.errors.status = HTTPBadRequest.code return
In the above API, I am explicitly setting the errors' status to Bad request.
But the API response status code is returned as 200.
When I add an error message into request.errors like (below), the status code is set properly.
request.errors.add('path', 'id', 'Invalid id')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi
I am writing a REST API using cornice. This is my code:
In the above API, I am explicitly setting the errors' status to Bad request.
But the API response status code is returned as 200.
When I add an error message into request.errors like (below), the status code is set properly.
request.errors.add('path', 'id', 'Invalid id')
The text was updated successfully, but these errors were encountered: