From 256f6acb559de81ab71dc58c6ce78523531c12d3 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Tue, 7 Aug 2012 09:46:27 +0200 Subject: [PATCH] [gen] More accurate error reporting for Action fields. --- gen/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gen/__init__.py b/gen/__init__.py index 88e6246..13abba6 100644 --- a/gen/__init__.py +++ b/gen/__init__.py @@ -957,12 +957,14 @@ class Type: except TypeError, te: # Try a version of the method that would accept self as an # additional parameter. + tb = Traceback.get() try: return method(obj, self) except Exception, e: - obj.log(Traceback.get(), type='error') - if raiseOnError: raise e - else: return str(e) + # Log the initial error. + obj.log(tb, type='error') + if raiseOnError: raise te + else: return str(te) except Exception, e: obj.log(Traceback.get(), type='error') if raiseOnError: raise e