Ñò
ô†³Kc @ sß d Z d d k Z d d k Z d d k Z y d d k l Z Wn# e j
o d d k l Z n Xd d k l Z l Z l
Z
d d k l Z d d k l
Z
d d g Z d e f d
„ ƒ YZ e ƒ Z d e f d „ ƒ YZ d e f d
„ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ e e d d e d d d d e d d e d „
Z e d „ Z d „ Z d „ Z e i i e ƒ Z xO e e e ƒ ƒ D]; Z! e e! i" ƒ i# d ƒ o d i$ e e! ƒ e _ Pq–q–W[! [ d S( s
Error handler middleware
iÿÿÿÿN( t StringIO( t formattert collectort reporter( t wsgilib( t requestt ErrorMiddlewaret handle_exceptiont
_NoDefaultc B s e Z d „ Z RS( c C s d S( Ns ( ( t self( ( sD /usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyt __repr__ s ( t __name__t
__module__R
( ( ( sD /usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyR s c B sY e Z d Z d e d d e d d d d e d d d d „
Z d „ Z d „ Z d „ Z RS( s³
Error handling middleware
Usage::
error_catching_wsgi_app = ErrorMiddleware(wsgi_app)
Settings:
``debug``:
If true, then tracebacks will be shown in the browser.
``error_email``:
an email address (or list of addresses) to send exception
reports to
``error_log``:
a filename to append tracebacks to
``show_exceptions_in_wsgi_errors``:
If true, then errors will be printed to ``wsgi.errors``
(frequently a server error log, or stderr).
``from_address``, ``smtp_server``, ``error_subject_prefix``, ``smtp_username``, ``smtp_password``, ``smtp_use_tls``:
variables to control the emailed exception reports
``error_message``:
When debug mode is off, the error message to show to users.
``xmlhttp_key``:
When this key (default ``_``) is in the request GET variables
(not POST!), expect that this is an XMLHttpRequest, and the
response should be more minimal; it should not be a complete
HTML page.
Environment Configuration:
``paste.throw_errors``:
If this setting in the request environment is true, then this
middleware is disabled. This can be useful in a testing situation
where you don't want errors to be caught and transformed.
``paste.expected_exceptions``:
When this middleware encounters an exception listed in this
environment variable and when the ``start_response`` has not
yet occurred, the exception will be re-raised instead of being
caught. This should generally be set by middleware that may
(but probably shouldn't be) installed above this middleware,
and wants to get certain exceptions. Exceptions raised after
``start_response`` have been called are always caught since
by definition they are no longer expected.
c C s d d k l } | | _ | d j o
h } n | t j o | i | i d ƒ ƒ } n | t j o | i | i d ƒ ƒ } n | i | ƒ | _ | d j oC | i d ƒ p- | i d ƒ p | i d ƒ p
| i d ƒ } n | i | ƒ | _ | | _
| | _ | d j o | i d d
ƒ } n | | _ | d j o | i d d ƒ } n | | _
| p
| i d
ƒ | _ |
p
| i d ƒ | _ | p | i | i d ƒ ƒ | _ | p d | _ |
d j o | i d ƒ }
n |
| _ | d j o | i d d ƒ } n | | _ d S( Niÿÿÿÿ( t
converterst debugt show_exceptions_in_wsgi_errorst error_emailt admin_emailt webmaster_emailt sysadmin_emailt error_from_addresss errors@localhostt smtp_servert localhostt
smtp_usernamet
smtp_passwordt smtp_use_tlst t
error_messaget xmlhttp_keyt _( t
paste.utilR
t applicationt Nonet NoDefaultt asboolt gett
debug_modet aslistR t error_logR t from_addressR R R R t error_subject_prefixR R ( R R t global_confR R R&