File tree 2 files changed +17
-9
lines changed
packages/models-library/src/models_library/api_schemas_payments
services/payments/src/simcore_service_payments/core
2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 1
1
from pydantic .errors import PydanticErrorMixin
2
2
3
3
4
- class BaseServiceError (PydanticErrorMixin , ValueError ):
4
+ class _BaseServiceApiError (PydanticErrorMixin , ValueError ):
5
5
@classmethod
6
6
def get_full_class_name (cls ) -> str :
7
7
# Can be used as unique code identifier
8
8
return f"{ cls .__module__ } .{ cls .__name__ } "
9
9
10
10
11
11
#
12
- # service wide errors
12
+ # service- wide errors
13
13
#
14
14
15
15
16
- class PaymentServiceUnavailableError (BaseServiceError ):
16
+ class PaymentServiceUnavailableError (_BaseServiceApiError ):
17
17
msg_template = "Payments are currently unavailable: {human_reason}"
18
18
19
19
20
20
#
21
- # payments
21
+ # payment transactions errors
22
22
#
23
23
24
24
25
- class PaymentsError (BaseServiceError ):
25
+ class PaymentsError (_BaseServiceApiError ):
26
26
msg_template = "Error in payment transaction '{payment_id}'"
27
27
28
28
@@ -39,11 +39,11 @@ class PaymentAlreadyAckedError(PaymentsError):
39
39
40
40
41
41
#
42
- # payment-methods
42
+ # payment-methods errors
43
43
#
44
44
45
45
46
- class PaymentsMethodsError (BaseServiceError ):
46
+ class PaymentsMethodsError (_BaseServiceApiError ):
47
47
...
48
48
49
49
Original file line number Diff line number Diff line change 1
- from models_library .api_schemas_payments .errors import BaseServiceError
1
+ from pydantic .errors import PydanticErrorMixin
2
+
3
+
4
+ class _BaseServiceInternalError (PydanticErrorMixin , ValueError ):
5
+ @classmethod
6
+ def get_full_class_name (cls ) -> str :
7
+ # Can be used as unique code identifier
8
+ return f"{ cls .__module__ } .{ cls .__name__ } "
9
+
2
10
3
11
#
4
12
# gateway errors
5
13
#
6
14
7
15
8
- class PaymentsGatewayError (BaseServiceError ):
16
+ class PaymentsGatewayError (_BaseServiceInternalError ):
9
17
...
10
18
11
19
You can’t perform that action at this time.
0 commit comments