X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=a1%2Fexceptions.py;h=b7d1244f2f03642fd3b5e45733b0e58b41b6d816;hb=d7858cf453b4f74cd4dad0e13106218ea9a56785;hp=1362b2ab60f987ed59ef5269849e7d6468096a81;hpb=91ae88989c82b08b9fb69a28f838d6b80681d953;p=ric-plt%2Fa1.git diff --git a/a1/exceptions.py b/a1/exceptions.py index 1362b2a..b7d1244 100644 --- a/a1/exceptions.py +++ b/a1/exceptions.py @@ -19,25 +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 PolicyTypeAlreadyExists(BaseException): - """a policy type already exists and replace not supported at this time""" +class PolicyInstanceNotFound(A1Error): + """a policy instance cannot be found""" -class MissingRmrString(BaseException): - pass + +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"""