-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathkombogeneralerror.py
More file actions
33 lines (26 loc) · 1.08 KB
/
kombogeneralerror.py
File metadata and controls
33 lines (26 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from dataclasses import dataclass, field
import httpx
from kombo.errors import SDKError
from kombo.models import kombogeneralerror as models_kombogeneralerror
from kombo.types import BaseModel
from typing import Optional
class KomboGeneralErrorData(BaseModel):
status: models_kombogeneralerror.KomboGeneralErrorStatus
error: models_kombogeneralerror.KomboGeneralErrorError
r"""Error details with structured code for programmatic handling."""
@dataclass(unsafe_hash=True)
class KomboGeneralError(SDKError):
r"""The standard error response with just the platform error codes."""
data: KomboGeneralErrorData = field(hash=False)
def __init__(
self,
data: KomboGeneralErrorData,
raw_response: httpx.Response,
body: Optional[str] = None,
):
fallback = body or raw_response.text
message = str(data.error.message) or fallback
super().__init__(message, raw_response, body)
object.__setattr__(self, "data", data)