[DCAEGEN2] Update Administrative status for measurement group
[dcaegen2/services.git] / components / pm-subscription-handler / pmsh_service / mod / api / custom_exception.py
1 # ============LICENSE_START===================================================
2 #  Copyright (C) 2021-2022 Nordix Foundation.
3 # ============================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # SPDX-License-Identifier: Apache-2.0
17 # ============LICENSE_END=====================================================
18
19 class InvalidDataException(Exception):
20     """Exception raised for invalid inputs.
21
22     Attributes:
23         message -- detail on invalid data
24     """
25
26     def __init__(self, invalid_message):
27         super().__init__(invalid_message)
28
29
30 class DuplicateDataException(Exception):
31     """Exception raised for duplicate inputs.
32
33     Attributes:
34         message -- detail on duplicate field
35     """
36
37     def __init__(self, duplicate_field_info):
38         super().__init__(duplicate_field_info)
39
40
41 class DataConflictException(Exception):
42     """Exception raised for conflicting data state in PMSH.
43
44     Attributes:
45         message -- detail on conflicting data
46     """
47
48     def __init__(self, data_conflict_message):
49         super().__init__(data_conflict_message)