﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	launchpad_bug
971	"""Humanized failures"" should still have a traceback, hidden by default"	davidsarah	davidsarah	"Currently, failures that occur in a WUI operation (that is, a webapi operation with HTML output) go through [source:src/allmydata/web/common.py#L149 humanize_failure] in {{{web/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() ...
}}}
"	enhancement	assigned	major	soon	code-frontend-web	1.6.0		error privacy anonymity	kpreid@…	
