See my answer here: http://stackoverflow.com/a/18248136/1175818
Am Mittwoch, 14. August 2013 12:02:36 UTC+2 schrieb [email protected]: > > Hi, > > I want to use my own excepthook method in RootController: > > class RootController(BaseController): > secc = SecureController() > error = ErrorController() > > def __init__(self): > self.installExceptHook() > super(RootController, self).__init__() > > def installExceptHook(self): > def exceptHook(type, value, tb): > logger = logging.getLogger('app') > logger.critical(''.join(traceback.format_exception(type, value, > tb))) > sys.excepthook = exceptHook > > But when I try raise ValueError in index method: > > @expose('app.templates.index')def index(self, **kwargs): > raise ValueError > return dict(page = 'index') > > the exception is still raised (I get the classic WebError Traceback page > in the browser) and nothing is logged. I don't want the exception to raise, > just silently log it. Any idea? > -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/turbogears. For more options, visit https://groups.google.com/groups/opt_out.

