[docs]classGCSAPIError(exc.GlobusAPIError):""" Error class for the GCS Manager API client """def__init__(self,r:requests.Response)->None:self.detail_data_type:str|None=Noneself.detail:None|str|dict[str,t.Any]=Nonesuper().__init__(r)def_get_args(self)->list[t.Any]:args=super()._get_args()args.append(self.detail_data_type)# only add detail if it's a string (don't want to put a large object into# stacktraces)ifisinstance(self.detail,str):args.append(self.detail)returnargsdef_post_parse_hook(self)->bool:# detail can be a full document, so fetch, then look for a DATA_TYPE# and expose it as a top-level attribute for easy accessself.detail=self._dict_data.get("detail")ifisinstance(self.detail,dict)and"DATA_TYPE"inself.detail:self.detail_data_type=self.detail["DATA_TYPE"]returnTrue