On 2/10/06, Ian Bicking <[EMAIL PROTECTED]> wrote:
> It might be nice to look into merging some of the changes I made in the
> paste-error-reporting branch into Kid.  But to use that in TurboGears
> requires using Paste's exception formatter.  But if you want to move to
> paste.evalexception (which you should want to do), then you'd be doing
> that anyway.  That also gives you access to view local variables.

Local variables, yay!

What's up with TG's uninformative tracebacks?  Is that something
deep-seated or is it something we can fix at the sprint?  It's the
only thing that has made me wonder whether to switch back to Quixote. 
Three different errors during web requests; three uninformative
tracebacks.  I posted one of them to the list a couple days ago
(subject: Database / config problem).  Here's the middle of it:

 File 
"/usr/local/lib/python2.4/TurboGears-0.9a0dev_r663-py2.4.egg/turbogears/controllers.py",
line 184, in expose
   func, tg_format, html, fragment, *args, **kw)
 File 
"/usr/local/lib/python2.4/TurboGears-0.9a0dev_r663-py2.4.egg/turbogears/database.py",
line 193, in run_with_transaction
   retval = func(*args, **kw)
 File 
"/usr/local/lib/python2.4/TurboGears-0.9a0dev_r663-py2.4.egg/turbogears/controllers.py",
line 196, in _execute_func
   output = errorhandling.try_call(func, self, *args, **kw)
 File 
"/usr/local/lib/python2.4/TurboGears-0.9a0dev_r663-py2.4.egg/turbogears/errorhandling.py",
line 64, in try_call
   output = dispatch_error(func, self, error, *args, **kw)
 File "<string>", line 5, in dispatch_error
 File 
"/usr/local/lib/python2.4/TurboGears-0.9a0dev_r663-py2.4.egg/turbogears/errorhandling.py",
line 27, in _default_error_handler
   return getattr(self, error_source.__name__ )(*args, **kw)

The "expose" and "run_with_transaction" lines look like mundane
request dispatching.  I assume  'func' is the exposed method or
thereabouts.  Then suddenly it switches to 'dispatch_error' and goes
through a bunch of boring error-handling functions I don't care about,
and the part I *do* care about that caused the error is shown nowhere.
 Maybe it's buried in one of those "<string>" lines if it uses eval().
 When I did the same operations under  "tg-admin shell", I got a much
more informative traceback that showed exactly what the error was and
where.

--
Mike Orr <[EMAIL PROTECTED]>
([EMAIL PROTECTED] address is semi-reliable)

Reply via email to