Base class for every error the SDK raises.
| 43 | |
| 44 | |
| 45 | class E2AError(Exception): |
| 46 | """Base class for every error the SDK raises.""" |
| 47 | |
| 48 | def __init__( |
| 49 | self, |
| 50 | *, |
| 51 | code: str, |
| 52 | message: str, |
| 53 | status: int, |
| 54 | retryable: bool, |
| 55 | request_id: Optional[str] = None, |
| 56 | details: Any = None, |
| 57 | retry_after_seconds: Optional[float] = None, |
| 58 | ) -> None: |
| 59 | super().__init__(message) |
| 60 | #: Stable machine code from the envelope (e.g. ``"domain_not_verified"``). |
| 61 | self.code = code |
| 62 | self.message = message |
| 63 | #: HTTP status; ``0`` for a connection-level failure with no response. |
| 64 | self.status = status |
| 65 | #: ``X-Request-Id`` echoed by the server — quote it in support requests. |
| 66 | self.request_id = request_id |
| 67 | #: Structured field-level detail (envelope ``error.details``). |
| 68 | self.details = details |
| 69 | #: True when retrying could plausibly succeed (429 / 5xx / connection). |
| 70 | self.retryable = retryable |
| 71 | #: Seconds from a ``Retry-After`` header, when present. |
| 72 | self.retry_after_seconds = retry_after_seconds |
| 73 | |
| 74 | |
| 75 | class E2AAuthError(E2AError): |
no outgoing calls
no test coverage detected