X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=a1%2Fexceptions.py;h=b7d1244f2f03642fd3b5e45733b0e58b41b6d816;hb=refs%2Fchanges%2F15%2F6215%2F1;hp=b9242926d010efe35467a1b746963d1b695e9e98;hpb=40caa314d23122f0bd25c0e66b65d10303538164;p=ric-plt%2Fa1.git diff --git a/a1/exceptions.py b/a1/exceptions.py index b924292..b7d1244 100644 --- a/a1/exceptions.py +++ b/a1/exceptions.py @@ -19,21 +19,29 @@ Custom Exceptions """ -class PolicyInstanceNotFound(BaseException): - """a policy instance cannot be found""" +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 PolicyTypeNotFound(BaseException): - """a policy type instance cannot be found""" +class CantDeleteNonEmptyType(A1Error): + """tried to delete a type that isn't empty""" -class MissingRmrString(BaseException): - pass + +class PolicyInstanceNotFound(A1Error): + """a policy instance cannot be found""" + + +class PolicyTypeNotFound(A1Error): + """a policy type instance cannot be found""" -class MissingManifest(BaseException): - pass +class PolicyTypeAlreadyExists(A1Error): + """a policy type already exists and replace not supported at this time""" -class MissingRmrMapping(BaseException): - pass +class PolicyTypeIdMismatch(A1Error): + """a policy type request path ID differs from its body ID"""