blob: 41f05af4ea13dbc215d76053622062453ceb66e2 [file] [log] [blame]
Timo Tietavainen7085c422019-11-08 12:39:24 +02001# Copyright (c) 2019 AT&T Intellectual Property.
2# Copyright (c) 2018-2019 Nokia.
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
Timo Tietavainendada8462019-11-27 11:50:01 +020016#
17# This source code is part of the near-RT RIC (RAN Intelligent Controller)
18# platform project (RICP).
19#
20
21
22"Exceptions raised by the Shared Data Layer (SDL)."
23
Timo Tietavainen7085c422019-11-08 12:39:24 +020024
25class SdlTypeError(TypeError):
26 """
27 Exception for passing a function argument of wrong type.
28 It is likely that the same request will fail repeatedly. It is advised to investigate the exact
29 reason for the failure from the logs.
30 """
31 pass
32
Timo Tietavainendada8462019-11-27 11:50:01 +020033
Timo Tietavainen7085c422019-11-08 12:39:24 +020034class SdlException(Exception):
Timo Tietavainendada8462019-11-27 11:50:01 +020035 """Base exception class for Shared Data Layer (SDL) exceptions."""
Timo Tietavainen7085c422019-11-08 12:39:24 +020036 pass
37
Timo Tietavainendada8462019-11-27 11:50:01 +020038
Timo Tietavainen7085c422019-11-08 12:39:24 +020039class NotConnected(SdlException):
40 """
Timo Tietavainendada8462019-11-27 11:50:01 +020041 Exception for SDL not being connected to the database backend.
42 SDL is not connected to the backend data storage and therefore could not deliver the request
43 to the backend data storage. Data in the backend data storage has not been altered.
Timo Tietavainen7085c422019-11-08 12:39:24 +020044 Client is advised to try the operation again later.
45 """
46 pass
47
Timo Tietavainendada8462019-11-27 11:50:01 +020048
Timo Tietavainen7085c422019-11-08 12:39:24 +020049class BackendError(SdlException):
50 """
Timo Tietavainendada8462019-11-27 11:50:01 +020051 Exception for request processing failure in SDL database backend.
Timo Tietavainen7085c422019-11-08 12:39:24 +020052 In case of a write type request, data in the backend data storage may or may not have been
53 altered. Client is advised to try the operation again later.
54 """
55 pass
56
Timo Tietavainendada8462019-11-27 11:50:01 +020057
Timo Tietavainen7085c422019-11-08 12:39:24 +020058class RejectedByBackend(SdlException):
59 """
Timo Tietavainendada8462019-11-27 11:50:01 +020060 Exception for SDL database backend rejecting the request.
Timo Tietavainen7085c422019-11-08 12:39:24 +020061 Backend data storage rejected the request. In case of a write type request, data in the backend
62 data storage may or may not have been altered. It is likely that the same request will fail
63 repeatedly. It is advised to investigate the exact reason for the failure from the logs.
64 """
65 pass