Skip to content
New issue

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

Allow custom message on Bad Request (HTTP 400) return code. #121

Merged
merged 1 commit into from Dec 28, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/webapi.py
Expand Up @@ -122,10 +122,10 @@ def __init__(self, url, absolute=False):
class BadRequest(HTTPError):
"""`400 Bad Request` error."""
message = "bad request"
def __init__(self):
def __init__(self, message=None):
status = "400 Bad Request"
headers = {'Content-Type': 'text/html'}
HTTPError.__init__(self, status, headers, self.message)
HTTPError.__init__(self, status, headers, message or self.message)

badrequest = BadRequest

Expand Down