Created
April 28, 2017 10:23
-
-
Save sapiens-sapide/9fb212db28f81cf44413dc4d2f1b8205 to your computer and use it in GitHub Desktop.
raise a new http error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Unprocessable(HTTPClientError): | |
""" | |
subclass of :class:`~HTTPClientError` | |
This indicates that the body or headers failed validity checks, | |
preventing the server from being able to continue processing. | |
code: 422, title: Bad Request | |
""" | |
def __init__(self, error=None): | |
self.code = 422 | |
self.title = 'Unprocessable entity' | |
self.explanation = ('The server encounter when processing payload') | |
self.message = error.message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment