diff options
| author | ianb <devnull@localhost> | 2005-05-29 07:25:07 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-05-29 07:25:07 +0000 |
| commit | 74b491b025df284f864c9db2ebf02e39cb725567 (patch) | |
| tree | a4517edb95765e9ee751d252721431a1aa090f42 /paste/wsgilib.py | |
| parent | 9757a97237996b2396a494869bae9f40b74ae11e (diff) | |
| download | paste-74b491b025df284f864c9db2ebf02e39cb725567.tar.gz | |
An application for giving error reponses (like 404 reponses)
Diffstat (limited to 'paste/wsgilib.py')
| -rw-r--r-- | paste/wsgilib.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/paste/wsgilib.py b/paste/wsgilib.py index 018f3f8..6b027e4 100644 --- a/paste/wsgilib.py +++ b/paste/wsgilib.py @@ -182,6 +182,18 @@ def error_response(environ, error_code, message, ('content-length', str(len(body)))] return error_code, headers, body +def error_response_app(error_code, message, debug_message=None): + """ + An application that emits the given error response. + """ + def application(environ, start_response): + status, headers, body = error_response( + environ, error_code, message, + debug_message=debug_message) + start_response(status, headers) + return [body] + return application + def send_file(filename): """ Returns an application that will send the file at the given |
