Code Review
/
ric-plt
/
a1.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
F release step 1 of 2
[ric-plt/a1.git]
/
a1
/
exceptions.py
diff --git
a/a1/exceptions.py
b/a1/exceptions.py
index
c76e9f2
..
b7d1244
100644
(file)
--- a/
a1/exceptions.py
+++ b/
a1/exceptions.py
@@
-19,17
+19,29
@@
Custom Exceptions
"""
"""
-class CantDeleteNonEmptyType(BaseException):
+class A1Error(Exception):
+ """A base class for A1 exceptions."""
+
+ def __init__(self, message):
+ # Call the base class constructor with the parameters it needs
+ super(A1Error, self).__init__(message)
+
+
+class CantDeleteNonEmptyType(A1Error):
"""tried to delete a type that isn't empty"""
"""tried to delete a type that isn't empty"""
-class PolicyInstanceNotFound(
BaseException
):
+class PolicyInstanceNotFound(
A1Error
):
"""a policy instance cannot be found"""
"""a policy instance cannot be found"""
-class PolicyTypeNotFound(
BaseException
):
+class PolicyTypeNotFound(
A1Error
):
"""a policy type instance cannot be found"""
"""a policy type instance cannot be found"""
-class PolicyTypeAlreadyExists(
BaseException
):
+class PolicyTypeAlreadyExists(
A1Error
):
"""a policy type already exists and replace not supported at this time"""
"""a policy type already exists and replace not supported at this time"""
+
+
+class PolicyTypeIdMismatch(A1Error):
+ """a policy type request path ID differs from its body ID"""