From 9a56546c530f2ea657d79b8a4b0ae17efcad17bd Mon Sep 17 00:00:00 2001 From: ianb Date: Tue, 5 May 2009 19:36:22 +0000 Subject: Add a warning about the unused warning_level parameter --- paste/httpexceptions.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'paste/httpexceptions.py') 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 -- cgit v1.2.1