Ejemplo n.º 1
0
    def writeTraceback(self):
        """Output the traceback.

        Writes the traceback, with most of the work done
        by `WebUtils.HTMLForException.htmlForException`.
        """
        self.writeTitle('Traceback')
        self.write(f'<p><em>{self.servletPathname()}</em></p>')
        self.write(htmlForException(self._exc, self._formatOptions))
Ejemplo n.º 2
0
 def writeFancyTraceback(self):
     """Output a fancy traceback, using CGITraceback."""
     if self.setting('IncludeFancyTraceback'):
         self.writeTitle('Fancy Traceback')
         try:
             from WebUtils.ExpansiveHTMLForException import (
                 expansiveHTMLForException)
             self.write(
                 expansiveHTMLForException(
                     context=self.setting('FancyTracebackContext')))
         except Exception:
             self.write('<p>Unable to generate a fancy traceback'
                        ' (uncaught exception)!</p>')
             try:
                 self.write(htmlForException(sys.exc_info()))
             except Exception:
                 self.write('<p>Unable to even generate a normal traceback'
                            ' of the exception in fancy traceback!</p>')