Hi,

TG is working under the assumption all decorators are "well behaved", meaning they are either invariants or themselves decorated with decorator() from turbogears/decorator.py. For examples on how to use decorator() have a look at expose() or validate() in turbogears/controllers.py. Since our decorator library is based on work by Michele Simionato, his documentation [1] may prove viable as well.


Cheers,
Simon

[1] http://www.phyast.pitt.edu/~micheles/python/documentation.html



[EMAIL PROTECTED] wrote:
Hi,

Assuming if I have this :

class Test(object):
  @turbogears.expose()
  @my_deco
  def index(self):
     if something: raise MyException

The current default error dispatch mechanism seems to be trying to find
the func that raised the exception through the class "Test" which in
this case may not be true as I have decorated it(thus the getattr calls
itself in _default_error_handler failed).

What would be the right way to prevent this from happening(as this
would make debugging hard, not knowing the real source of the
exception) ?


Reply via email to