Better exception handling
[testsuite/pythonsdk-tests.git] / src / onaptests / utils / exceptions.py
1 # Copyright (c) 2018-2020 Orange and others.
2 #
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 """Module to define pythonsdk-test exceptions."""
8
9 __author__ = ("Morgan Richomme <morgan.richomme@orange.com>")
10
11 class  OnapTestException(Exception):
12     """Parent Class for all Onap Test Exceptions."""
13     error_message='Generic OnapTest exception'
14
15 class TestConfigurationException(OnapTestException):
16     """Raise when configutation of the use cases is not complete or buggy."""
17     error_message='Configuration error'
18
19 class ServiceDistributionException(OnapTestException):
20     """Service not properly distributed."""
21     error_message='Service not well distributed'
22
23
24 class ServiceInstantiateException(OnapTestException):
25     """Service cannot be instantiated."""
26     error_message='Service instantiation error'
27
28
29 class ServiceCleanupException(OnapTestException):
30     """Service cannot be cleaned."""
31     error_message='Service not well cleaned up'
32
33
34 class VnfInstantiateException(OnapTestException):
35     """VNF cannot be instantiated."""
36     error_message='VNF instantiation error'
37
38
39 class VnfCleanupException(OnapTestException):
40     """VNF cannot be cleaned."""
41     error_message="VNF can't be cleaned"
42
43
44 class VfModuleInstantiateException(OnapTestException):
45     """VF Module cannot be instantiated."""
46     error_message='VF Module instantiation error'
47
48
49 class VfModuleCleanupException(OnapTestException):
50     """VF Module cannot be cleaned."""
51     error_message="VF Module can't be cleaned"
52
53
54 class NetworkInstantiateException(OnapTestException):
55     """Network cannot be instantiate."""
56     error_message='Network instantiation error'
57
58
59 class NetworkCleanupException(OnapTestException):
60     """Network cannot be cleaned."""
61     error_message="Network can't be cleaned"
62
63 class ProfileInformationException(OnapTestException):
64     """Missing k8s profile information."""
65     error_message='"Missing k8s profile information'
66
67 class ProfileCleanupException(OnapTestException):
68     """K8s profile cannot be cleaned."""
69     error_message="Profile can't be cleaned"