[docs]classFlowsAPIError(GlobusAPIError):""" Error class to represent error responses from Flows. """def_parse_undefined_error_format(self)->bool:""" Treat any top-level "error" key as an "array of size 1". Meaning that we'll see a single subdocument for data shaped like { "error": { "foo": "bar" } } """# if there is not a top-level 'error' key, no special behavior is defined# fall-back to the base class implementationifnotisinstance(self._dict_data.get("error"),dict):returnsuper()._parse_undefined_error_format()self.errors=[ErrorSubdocument(self._dict_data["error"])]self.code=self._extract_code_from_error_array(self.errors)details=self._dict_data["error"].get("detail")if_guards.is_list_of(details,dict):self.messages=[error_detail["msg"]forerror_detailindetailsifisinstance(error_detail.get("msg"),str)]else:self.messages=self._extract_messages_from_error_array(self.errors)returnTrue