Debian Codegraph @

src/globus_sdk/services/search/errors.py

raw
1 from __future__ import annotations
2
3 import typing as t
4
5 import requests
6
7 from globus_sdk import exc
8
9
10 class SearchAPIError(exc.GlobusAPIError):
11 """
12 Error class for the Search API client. In addition to the
13 inherited instance variables, provides ``error_data``.
14
15 :ivar error_data: Additional object returned in the error response. May be
16 a dict, list, or None.
17 """
18
19 def __init__(self, r: requests.Response) -> None:
20 self.error_data: dict[str, t.Any] | None = None
21 super().__init__(r)
22
23 def _post_parse_hook(self) -> bool:
24 self.error_data = self._dict_data.get("error_data")
25 return True