1
##############################################################################
3
# Copyright (c) 2003 Zope Corporation and Contributors.
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE.
13
##############################################################################
14
"""View that renders a traceback for exceptions.
16
$Id: exceptions.py 26727 2004-07-23 21:13:09Z pruggera $
18
__docformat__ = 'restructuredtext'
23
from zope.interface.common.interfaces import IException
25
class ExceptionDebugView(object):
26
""" Render exceptions for debugging."""
27
__used_for__ = IException
29
def __init__(self, context, request):
31
self.context = context
32
self.request = request
34
self.error_type, self.error_object, tb = sys.exc_info()
36
self.traceback_lines = traceback.format_tb(tb)