iro/error.py
branchdevel
changeset 165 dd07766f4fee
parent 162 497d6b9b6914
child 189 ae2767918faa
--- a/iro/error.py	Tue Feb 14 21:27:51 2012 +0100
+++ b/iro/error.py	Tue Feb 14 21:30:17 2012 +0100
@@ -53,15 +53,36 @@
         ValidateException.__init__(self, 702, field, msg)
 
 class OfferException(Exception):
-    pass
+    def __init__(self, name):
+        self.name = name
 
 class NoRoute(OfferException):
-    pass
-class NoRouteForTask(Exception):
-    pass
+    def __str__(self):
+        return "Not a valid route: %s"%self.name
 
 class NoProvider(OfferException):
-    pass
+    def __str__(self):
+        return "Not a valid provider: %s"%self.name
+
+class NoTyp(OfferException):
+    def __str__(self):
+        return "Not a valid Typ: %s"%self.name
 
 class RejectRecipient(Exception):
     pass
+
+class ConfigException(Exception):
+    def __init__(self,section, name):
+        self.section = section
+        self.name = name
+
+class UnknownOption(ConfigException):
+    def __str__(self):
+        return "Unknown option '%s' in section '%s'."%(self.name, self.section)
+
+class NeededOption(ConfigException):
+    def __str__(self):
+        return "Option '%s' in section '%s' is missing."%(self.name, self.section)
+
+class NoRouteForTask(Exception):
+    pass