aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/sdkerror.py
blob: 2e7ef21120229603252ff853c9dad136d4dc1480 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

import requests as requests_http


class SDKError(Exception):
    """Represents an error returned by the API."""
    message: str
    status_code: int
    body: str
    raw_response: requests_http.Response

    def __init__(self, message: str, status_code: int, body: str, raw_response: requests_http.Response):
        self.message = message
        self.status_code = status_code
        self.body = body
        self.raw_response = raw_response

    def __str__(self):
        body = ''
        if len(self.body) > 0:
            body = f'\n{self.body}'

        return f'{self.message}: Status {self.status_code}{body}'