Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sapiens-sapide/9fb212db28f81cf44413dc4d2f1b8205 to your computer and use it in GitHub Desktop.
Save sapiens-sapide/9fb212db28f81cf44413dc4d2f1b8205 to your computer and use it in GitHub Desktop.
raise a new http error
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