#NEWLINE# def error_response( environ , error_code , message , debug_message = None , __warn = True ) : #NEWLINE# #INDENT# '\n    Returns the status, headers, and body of an error response.\n\n    Use like:\n\n    .. code-block:: python\n\n        status, headers, body = wsgilib.error_response(\n            \'301 Moved Permanently\', \'Moved to <a href="%s">%s</a>\'\n            % (url, url))\n        start_response(status, headers)\n        return [body]\n\n    **Note:** Deprecated\n    ' #NEWLINE# if __warn : #NEWLINE# #INDENT# warnings . warn ( 'wsgilib.error_response is deprecated; use the wsgi_application method on an HTTPException object instead' , DeprecationWarning , 2 ) #NEWLINE# #UNINDENT# if ( debug_message and environ . get ( 'paste.config' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) . get ( 'debug' ) ) : #NEWLINE# #INDENT# message += ( '\n\n<!-- %s -->' % debug_message ) #NEWLINE# #UNINDENT# body = error_body_response ( error_code , message , __warn = False ) #NEWLINE# headers = [ ( 'content-type' , 'text/html' ) , ( 'content-length' , str ( len ( body ) ) ) ] #NEWLINE# return ( error_code , headers , message )