Permalink
Browse files

Merge pull request #121 from patryk/master

Allow custom message on Bad Request (HTTP 400) return code.
  • Loading branch information...
2 parents 02d6adf + 49ead86 commit 38734bb47240ff2ef36d8b27c486399b9d71adaa @aaronsw aaronsw committed Dec 28, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 web/webapi.py
View
@@ -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

0 comments on commit 38734bb

Please sign in to comment.