#971 assigned enhancement

"Humanized failures" should still have a traceback, hidden by default — at Initial Version

Reported by: davidsarah Owned by:
Priority: major Milestone: soon
Component: code-frontend-web Version: 1.6.0
Keywords: error privacy anonymity Cc: kpreid@…
Launchpad Bug:

Description

Currently, failures that occur in a WUI operation (that is, a webapi operation with HTML output) go through humanize_failure in test/common.py, in order to produce a more informative error message. This is better in most cases than dumping an exception traceback, but sometimes you really do also want the traceback for debugging.

DHTML could be used to hide the traceback by default, like this:

<!doctype html>
<html>
  <head>
    <script type="text/javascript">
      function toggleDebug() {
        var el = document.getElementById('debug');
        show = el.style.display === 'none';
        el.style.display = show ? '' : 'none';
        document.getElementById('toggle').innerHTML =
          show ? 'Hide debugging information' : 'Show debugging information';
      }
      window.onload = toggleDebug;
    </script>
  </head>
<body>
  <p>
  <a id="toggle" onclick="toggleDebug();"
     style="text-decoration: none; border-bottom: 1px dashed #000000"></a>
  </p>
  <div id="debug"><p>Traceback</p></div>
</body>
</html>

A traceback can be obtained from a twisted.python.failure.Failure object using:

  from StringIO import StringIO
  sfile = StringIO()
  f.printTraceback(sfile)  # or printDetailedTraceback
  sfile.flush()
  ... sfile.getvalue() ...

Change History (0)

Note: See TracTickets for help on using tickets.