[kupfer] Introduce OperationError exception: (localized) failure in actions



commit 716e23e67fc38ba6db87b1aa83151c7fc9001c48
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sat Feb 13 15:43:47 2010 +0100

    Introduce OperationError exception: (localized) failure in actions

 kupfer/obj/base.py |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/kupfer/obj/base.py b/kupfer/obj/base.py
index 579136e..1084b23 100644
--- a/kupfer/obj/base.py
+++ b/kupfer/obj/base.py
@@ -5,7 +5,8 @@ from kupfer.utils import locale_sort
 from kupfer.kupferstring import tounicode, toutf8, tofolded
 
 __all__ = [
-	"InvalidDataError", "KupferObject", "Leaf", "Action", "Source", "TextSource"
+	"Error", "InvalidDataError", "OperationError", "InvalidLeafError",
+	"KupferObject", "Leaf", "Action", "Source", "TextSource",
 ]
 
 # If no gettext function is loaded at this point, we load a substitute,
@@ -19,12 +20,13 @@ class Error (Exception):
 	pass
 
 class InvalidDataError (Error):
-	"""The data is wrong for the given Leaf"""
-	pass
+	"The data is wrong for the given Leaf"
 
-class InvalidLeafError (Error):
-	"""The Leaf passed to an Action is invalid"""
-	pass
+class OperationError (Error):
+	"Command execution experienced an error"
+
+class InvalidLeafError (OperationError):
+	"The Leaf passed to an Action is invalid"
 
 _builtin_modules = frozenset([
 	"kupfer.obj.objects",



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