Skip to content

Commit

Permalink
Merge pull request #121 from patryk/master
Browse files Browse the repository at this point in the history
Allow custom message on Bad Request (HTTP 400) return code.
  • Loading branch information
aaronsw committed Dec 28, 2011
2 parents 02d6adf + 49ead86 commit 38734bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/webapi.py
Expand Up @@ -122,10 +122,10 @@ def __init__(self, url, absolute=False):
class BadRequest(HTTPError): class BadRequest(HTTPError):
"""`400 Bad Request` error.""" """`400 Bad Request` error."""
message = "bad request" message = "bad request"
def __init__(self): def __init__(self, message=None):
status = "400 Bad Request" status = "400 Bad Request"
headers = {'Content-Type': 'text/html'} headers = {'Content-Type': 'text/html'}
HTTPError.__init__(self, status, headers, self.message) HTTPError.__init__(self, status, headers, message or self.message)


badrequest = BadRequest badrequest = BadRequest


Expand Down

0 comments on commit 38734bb

Please sign in to comment.