diff options
author | ianb <devnull@localhost> | 2009-05-05 19:36:22 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2009-05-05 19:36:22 +0000 |
commit | 9a56546c530f2ea657d79b8a4b0ae17efcad17bd (patch) | |
tree | 97d5e1ebab240310bdbf5f6609e928300f9a80c8 /paste/httpexceptions.py | |
parent | fc5423121bf4784730983071ebe2020c2addb1e9 (diff) | |
download | paste-9a56546c530f2ea657d79b8a4b0ae17efcad17bd.tar.gz |
Add a warning about the unused warning_level parameter
Diffstat (limited to 'paste/httpexceptions.py')
-rw-r--r-- | paste/httpexceptions.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/paste/httpexceptions.py b/paste/httpexceptions.py index 4d7f1a2..8e2f81c 100644 --- a/paste/httpexceptions.py +++ b/paste/httpexceptions.py @@ -605,15 +605,6 @@ class HTTPExceptionHandler(object): """ catches exceptions and turns them into proper HTTP responses - Attributes: - - ``warning_level`` - This attribute determines for what exceptions a stack - trace is kept for lower level reporting; by default, it - only keeps stack trace for 5xx, HTTPServerError exceptions. - To keep a stack trace for 4xx, HTTPClientError exceptions, - set this to 400. - This middleware catches any exceptions (which are subclasses of ``HTTPException``) and turns them into proper HTTP responses. Note if the headers have already been sent, the stack trace is @@ -627,6 +618,10 @@ class HTTPExceptionHandler(object): def __init__(self, application, warning_level=None): assert not warning_level or ( warning_level > 99 and warning_level < 600) + if warning_level is not None: + import warnings + warnings.warn('The warning_level parameter is not used or supported', + DeprecationWarning, 2) self.warning_level = warning_level or 500 self.application = application |