From: richard Date: Tue, 21 Jan 2003 23:54:28 +0000 (+0000) Subject: extra info in template error report X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=31ba6d2972f15e07205c785e65ffa13658919cf9;p=roundup.git extra info in template error report git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1473 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/cgi/cgitb.py b/roundup/cgi/cgitb.py index fab2484..d74426b 100644 --- a/roundup/cgi/cgitb.py +++ b/roundup/cgi/cgitb.py @@ -1,7 +1,7 @@ # # This module was written by Ka-Ping Yee, . # -# $Id: cgitb.py,v 1.7 2002-09-25 02:10:25 richard Exp $ +# $Id: cgitb.py,v 1.8 2003-01-21 23:54:28 richard Exp $ __doc__ = """ Extended CGI traceback handler by Ka-Ping Yee, . @@ -25,9 +25,12 @@ def niceDict(indent, dict): return '\n'.join(l) def pt_html(context=5): - l = ['

Templating Error

' - '

Debugging information follows

' - '
    '] + esc = cgi.escape + l = ['

    Templating Error

    ', + '

    %s: %s

    '%(esc(str(sys.exc_type)), + esc(str(sys.exc_value))), + '

    Debugging information follows

    ', + '
      ',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() @@ -38,12 +41,12 @@ def pt_html(context=5): if isinstance(ti, TraversalError): s = [] for name, info in ti.path: - s.append('
    1. "%s" (%s)
    2. '%(name,cgi.escape(repr(info)))) + s.append('
    3. "%s" (%s)
    4. '%(name, esc(repr(info)))) s = '\n'.join(s) l.append('
    5. Looking for "%s", current path:
        %s
    6. '%( ti.name, s)) else: - l.append('
    7. In %s
    8. '%cgi.escape(str(ti))) + l.append('
    9. In %s
    10. '%esc(str(ti))) if locals.has_key('__traceback_supplement__'): ts = locals['__traceback_supplement__'] if len(ts) == 2: @@ -51,7 +54,7 @@ def pt_html(context=5): s = 'A problem occurred in your template "%s".'%str(context.id) if context._v_errors: s = s + '
      ' + '
      '.join( - [cgi.escape(x) for x in context._v_errors]) + [esc(x) for x in context._v_errors]) l.append('
    11. %s
    12. '%s) elif len(ts) == 3: supp, context, info = ts