X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Fexceptions.py;h=815d4eab3dd929315081509a096711fa5f2bff09;hp=35962b2ba2fdef4b05626f056a3722a2d3d95718;hb=refs%2Fchanges%2F72%2F8772%2F2;hpb=2d413435b8530cf7b2c8e49cf8cf157679e72432 diff --git a/n2vc/exceptions.py b/n2vc/exceptions.py index 35962b2..815d4ea 100644 --- a/n2vc/exceptions.py +++ b/n2vc/exceptions.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + class JujuCharmNotFound(Exception): """The Charm can't be found or is not readable.""" @@ -40,10 +41,6 @@ class AuthenticationFailed(Exception): """The authentication for the specified user failed.""" -class InvalidCACertificate(Exception): - """The CA Certificate is not valid.""" - - class NotImplemented(Exception): """The method is not implemented.""" @@ -127,3 +124,30 @@ class N2VCInvalidCertificate(N2VCException): def __str__(self): return '<{}> Invalid certificate: {}'.format(type(self), super().__str__()) + +class N2VCNotFound(N2VCException): + """ + Not found + """ + + def __init__(self, message: str = ''): + N2VCException.__init__(self, message=message) + + def __str__(self): + return '<{}> Not found: {}'.format(type(self), super().__str__()) + + +class K8sException(Exception): + """ + K8s exception + """ + + def __init__(self, message: str): + Exception.__init__(self, message) + self._message = message + + def __str__(self): + return self._message + + def __repr__(self): + return self._message