Commits

Mark Lavin  committed 54b1c2f

Refactoring exceptions.

  • Participants
  • Parent commits cf9d9c9

Comments (0)

Files changed (2)

File selectable/exceptions.py

+class LookupAlreadyRegistered(Exception):
+    "Exception when trying to register a lookup which is already registered."
+
+
+class LookupNotRegistered(Exception):
+    "Exception when trying use a lookup which is not registered."
+
+
+class LookupInvalid(Exception):
+    "Exception when register an invalid lookup class."

File selectable/registry.py

 from django.utils.encoding import force_unicode
 
 from selectable.base import LookupBase
-
-
-class LookupAlreadyRegistered(Exception):
-    pass
-
-
-class LookupNotRegistered(Exception):
-    pass
-
-
-class LookupInvalid(Exception):
-    pass
+from selectable.exceptions import (LookupAlreadyRegistered, LookupNotRegistered,
+                                    LookupInvalid)
 
 
 class LookupRegistry(object):