InvalidLocaleError is more a LookupError than a ValueError.
[python-collate.git] / collate / errors.py
index cef5c07..a425087 100644 (file)
@@ -1,2 +1,11 @@
-class InvalidLocaleError(ValueError):
-    pass
+"""Exception types for the collate module."""
+
+class InvalidLocaleError(LookupError):
+    """Raised when an invalid locale is given to a function.
+
+    Attributes:
+    locale - the attempted invalid locale 
+    """
+    def __init__(self, locale, string=""):
+        self.locale = locale
+        ValueError.__init__(self, string or locale)