[kupfer] Forward traceback in command execution



commit 3ae8a570033501a8412a4ea94cbb55369f7d7be5
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Wed Mar 3 16:46:44 2010 +0100

    Forward traceback in command execution
    
    Use the original traceback when forwarding operation errors as action
    execution errors. Print the full exception traceback in debug mode.

 kupfer/commandexec.py |    4 ++--
 kupfer/core/data.py   |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/kupfer/commandexec.py b/kupfer/commandexec.py
index cc43bcb..bfc87e5 100644
--- a/kupfer/commandexec.py
+++ b/kupfer/commandexec.py
@@ -154,10 +154,10 @@ class ActionExecutionContext (gobject.GObject, pretty.OutputMixin):
 		try:
 			yield
 		except OperationError:
-			self.output_debug(sys.exc_info())
 			if not self.operation_error(sys.exc_info(), cmdtuple):
 				raise
-			raise ActionExecutionError("Encountered an Operation Error")
+			etype, value, tb = sys.exc_info()
+			raise ActionExecutionError, value, tb
 
 	def operation_error(self, exc_info, cmdtuple):
 		"Error when executing action. Return True when error was handled"
diff --git a/kupfer/core/data.py b/kupfer/core/data.py
index 7c5b5bc..ef04c59 100644
--- a/kupfer/core/data.py
+++ b/kupfer/core/data.py
@@ -741,8 +741,8 @@ class DataController (gobject.GObject, pretty.OutputMixin):
 		try:
 			ctx = self._execution_context
 			res, ret = ctx.run(leaf, action, sobject)
-		except commandexec.ActionExecutionError, exc:
-			self.output_error(exc)
+		except commandexec.ActionExecutionError:
+			self.output_exc()
 			return
 
 		# register search to learning database



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]