Timo Tietavainen | 7085c42 | 2019-11-08 12:39:24 +0200 | [diff] [blame] | 1 | # 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 Tietavainen | dada846 | 2019-11-27 11:50:01 +0200 | [diff] [blame] | 16 | # |
| 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 Tietavainen | 7085c42 | 2019-11-08 12:39:24 +0200 | [diff] [blame] | 24 | |
| 25 | class 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 Tietavainen | dada846 | 2019-11-27 11:50:01 +0200 | [diff] [blame] | 33 | |
Timo Tietavainen | 7085c42 | 2019-11-08 12:39:24 +0200 | [diff] [blame] | 34 | class SdlException(Exception): |
Timo Tietavainen | dada846 | 2019-11-27 11:50:01 +0200 | [diff] [blame] | 35 | """Base exception class for Shared Data Layer (SDL) exceptions.""" |
Timo Tietavainen | 7085c42 | 2019-11-08 12:39:24 +0200 | [diff] [blame] | 36 | pass |
| 37 | |
Timo Tietavainen | dada846 | 2019-11-27 11:50:01 +0200 | [diff] [blame] | 38 | |
Timo Tietavainen | 7085c42 | 2019-11-08 12:39:24 +0200 | [diff] [blame] | 39 | class NotConnected(SdlException): |
| 40 | """ |
Timo Tietavainen | dada846 | 2019-11-27 11:50:01 +0200 | [diff] [blame] | 41 | 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 Tietavainen | 7085c42 | 2019-11-08 12:39:24 +0200 | [diff] [blame] | 44 | Client is advised to try the operation again later. |
| 45 | """ |
| 46 | pass |
| 47 | |
Timo Tietavainen | dada846 | 2019-11-27 11:50:01 +0200 | [diff] [blame] | 48 | |
Timo Tietavainen | 7085c42 | 2019-11-08 12:39:24 +0200 | [diff] [blame] | 49 | class BackendError(SdlException): |
| 50 | """ |
Timo Tietavainen | dada846 | 2019-11-27 11:50:01 +0200 | [diff] [blame] | 51 | Exception for request processing failure in SDL database backend. |
Timo Tietavainen | 7085c42 | 2019-11-08 12:39:24 +0200 | [diff] [blame] | 52 | 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 Tietavainen | dada846 | 2019-11-27 11:50:01 +0200 | [diff] [blame] | 57 | |
Timo Tietavainen | 7085c42 | 2019-11-08 12:39:24 +0200 | [diff] [blame] | 58 | class RejectedByBackend(SdlException): |
| 59 | """ |
Timo Tietavainen | dada846 | 2019-11-27 11:50:01 +0200 | [diff] [blame] | 60 | Exception for SDL database backend rejecting the request. |
Timo Tietavainen | 7085c42 | 2019-11-08 12:39:24 +0200 | [diff] [blame] | 61 | 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 |