summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--paste/wsgilib.py12
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