diff options
author | Bert JW Regeer <bertjw@regeer.org> | 2019-12-12 13:36:08 -0800 |
---|---|---|
committer | Bert JW Regeer <bertjw@regeer.org> | 2019-12-19 15:59:57 +0100 |
commit | 7ff1e6b19d3754669d9473104070798f763b56ec (patch) | |
tree | f7daf77a7301630024d19188af6709745194e564 | |
parent | 7009d1bd03866ad7ffce6a9c64182ff8b1906b32 (diff) | |
download | waitress-7ff1e6b19d3754669d9473104070798f763b56ec.tar.gz |
Make sure all errors have a code/reason
Silences some warnings in my editor, and makes sure if it is subclassed
in the future we don't blow up in code somewhere.
-rw-r--r-- | waitress/utilities.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/waitress/utilities.py b/waitress/utilities.py index c77af49..ab093b5 100644 --- a/waitress/utilities.py +++ b/waitress/utilities.py @@ -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 @@ -280,6 +283,7 @@ class Error(object): 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): |