X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Fexceptions.py;h=a663c6284391c9895f09a8329cb8dc867d8f019d;hp=4b83e3ffa97c79b764058eaab1f01e5255ce78f9;hb=9ca46a8c173c2c62298173cea44fc40df886e45e;hpb=ac4e0dec95b3f18b57ee176136cb9885a8f3e2e1;ds=sidebyside diff --git a/n2vc/exceptions.py b/n2vc/exceptions.py index 4b83e3f..a663c62 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,6 +41,10 @@ class AuthenticationFailed(Exception): """The authentication for the specified user failed.""" +class NotImplemented(Exception): + """The method is not implemented.""" + + class N2VCException(Exception): """ N2VC exception base class @@ -107,6 +112,7 @@ class N2VCExecutionException(N2VCException): def __str__(self): return '<{}> Error executing primitive {} failed: {}'.format(type(self), self.primitive_name, super().__str__()) + class N2VCInvalidCertificate(N2VCException): """ Invalid certificate @@ -117,3 +123,19 @@ class N2VCInvalidCertificate(N2VCException): def __str__(self): return '<{}> Invalid certificate: {}'.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