1
1
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
from dataclasses import dataclass , field
4
- from typing import Literal , Protocol , runtime_checkable
4
+ from typing import Literal
5
5
6
6
7
7
class SmithyException (Exception ):
@@ -16,8 +16,21 @@ class SmithyException(Exception):
16
16
17
17
18
18
@dataclass (kw_only = True )
19
- @runtime_checkable
20
- class RetryInfo (Protocol ):
19
+ class CallException (SmithyException ):
20
+ """Base exception to be used in application-level errors.
21
+
22
+ Implements :py:class:`.interfaces.retries.ErrorRetryInfo`.
23
+ """
24
+
25
+ fault : Fault = None
26
+ """Whether the client or server is at fault.
27
+
28
+ If None, then there was not enough information to determine fault.
29
+ """
30
+
31
+ message : str = field (default = "" , kw_only = False )
32
+ """The message of the error."""
33
+
21
34
is_retry_safe : bool | None = None
22
35
"""Whether the exception is safe to retry.
23
36
@@ -37,20 +50,6 @@ class RetryInfo(Protocol):
37
50
is_throttle : bool = False
38
51
"""Whether the error is a throttling error."""
39
52
40
-
41
- @dataclass (kw_only = True )
42
- class CallException (SmithyException , RetryInfo ):
43
- """Base exception to be used in application-level errors."""
44
-
45
- fault : Fault = None
46
- """Whether the client or server is at fault.
47
-
48
- If None, then there was not enough information to determine fault.
49
- """
50
-
51
- message : str = field (default = "" , kw_only = False )
52
- """The message of the error."""
53
-
54
53
def __post_init__ (self ):
55
54
super ().__init__ (self .message )
56
55
0 commit comments