Skip to content

Commit

Permalink
Make sure all errors have a code/reason
Browse files Browse the repository at this point in the history
Silences some warnings in my editor, and makes sure if it is subclassed
in the future we don't blow up in code somewhere.
  • Loading branch information
digitalresistor committed Dec 19, 2019
1 parent 7009d1b commit 7ff1e6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions waitress/utilities.py
Expand Up @@ -271,6 +271,9 @@ def cleanup_unix_socket(path):


class Error(object):
code = 500
reason = "Internal Server Error"

def __init__(self, body):
self.body = body

Expand All @@ -280,6 +283,7 @@ def to_response(self):
tag = "\r\n\r\n(generated by waitress)"
body = body + tag
headers = [("Content-Type", "text/plain")]

return status, headers, body

def wsgi_response(self, environ, start_response):
Expand Down

0 comments on commit 7ff1e6b

Please sign in to comment.