1 # ==================================================================================
2 # Copyright (c) 2019 Nokia
3 # Copyright (c) 2018-2019 AT&T Intellectual Property.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ==================================================================================
22 class A1Error(Exception):
23 """A base class for A1 exceptions."""
25 def __init__(self, message):
26 # Call the base class constructor with the parameters it needs
27 super(A1Error, self).__init__(message)
30 class CantDeleteNonEmptyType(A1Error):
31 """tried to delete a type that isn't empty"""
34 class PolicyInstanceNotFound(A1Error):
35 """a policy instance cannot be found"""
38 class PolicyTypeNotFound(A1Error):
39 """a policy type instance cannot be found"""
42 class PolicyTypeAlreadyExists(A1Error):
43 """a policy type already exists and replace not supported at this time"""
46 class PolicyTypeIdMismatch(A1Error):
47 """a policy type request path ID differs from its body ID"""