Hi all:

I wrote the sources below:

    from django.views.debug import ExceptionReporter
    def recordErrorPage(R, **kw):
        if kw.has_key('exc_info'):
            reporter = ExceptionReporter(R, *kw['exc_info'])
            bug_html = reporter.get_traceback_html()
           # bug_html is the content of default Django debug info
page.
        else:
            bug_html = 'no exc_info'
        bp = BugPage(html=bug_html)
        bp.save()

        t = get_template('customize_500.html')
        # this customize_500.html has few information for client.
        html = t.render(RequestContext(R, {'bug_page': bp}))
        return HttpResponseServerError(html, mimetype='text/html')

    handler500 = 'recordErrorPage'

But this method must add a line("param_dict['exc_info'] = exc_info")
in the Django framework library(django/core/handlers/base.py near 166
line)
to let recordErrorPage gets the "exc_info" variable.  This is so
dirty.

Perhaps i should use the middleware framework to implement this
feature.
but i read the Django document, the "process_exception" function can
not get the "exc_info" variable, so i can not render a debug info page
like django default page.

Any suggestion?

Thank you so much.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to