1 # Copyright (c) 2019 AT&T Intellectual Property.
2 # Copyright (c) 2018-2019 Nokia.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 "Exceptions raised by the shareddatalayer."
18 class SdlTypeError(TypeError):
20 Exception for passing a function argument of wrong type.
21 It is likely that the same request will fail repeatedly. It is advised to investigate the exact
22 reason for the failure from the logs.
26 class SdlException(Exception):
27 """Base exception class for shareddatalayer exceptions."""
30 class NotConnected(SdlException):
32 Exception for not being connected to the database backend.
33 Shareddatalayer is not connected to the backend data storage and therefore could not deliver the
34 request to the backend data storage. Data in the backend data storage has not been altered.
35 Client is advised to try the operation again later.
39 class BackendError(SdlException):
41 Exception for request processing failure.
42 In case of a write type request, data in the backend data storage may or may not have been
43 altered. Client is advised to try the operation again later.
47 class RejectedByBackend(SdlException):
49 Exception for shareddatalayer rejecting the request.
50 Backend data storage rejected the request. In case of a write type request, data in the backend
51 data storage may or may not have been altered. It is likely that the same request will fail
52 repeatedly. It is advised to investigate the exact reason for the failure from the logs.