MCPcopy Index your code
hub / github.com/dataforseo/PythonClient / __init__

Method __init__

dataforseo_client/exceptions.py:77–102  ·  view source on GitHub ↗
(
        self, 
        status=None, 
        reason=None, 
        http_resp=None,
        *,
        body: Optional[str] = None,
        data: Optional[Any] = None,
    )

Source from the content-addressed store, hash-verified

75class ApiException(OpenApiException):
76
77 def __init__(
78 self,
79 status=None,
80 reason=None,
81 http_resp=None,
82 *,
83 body: Optional[str] = None,
84 data: Optional[Any] = None,
85 ) -> None:
86 self.status = status
87 self.reason = reason
88 self.body = body
89 self.data = data
90 self.headers = None
91
92 if http_resp:
93 if self.status is None:
94 self.status = http_resp.status
95 if self.reason is None:
96 self.reason = http_resp.reason
97 if self.body is None:
98 try:
99 self.body = http_resp.data.decode('utf-8')
100 except Exception:
101 pass
102 self.headers = http_resp.getheaders()
103
104 @classmethod
105 def from_response(

Callers

nothing calls this directly

Calls 1

getheadersMethod · 0.80

Tested by

no test coverage detected