ADD:try catch
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -1905,7 +1905,11 @@ class SearchGBHistoryFileView(GenericView): | ... | @@ -1905,7 +1905,11 @@ class SearchGBHistoryFileView(GenericView): |
1905 | gb_history_file_class = HILGreenBookHistoryFile if business_type in consts.HIL_SET else AFCGreenBookHistoryFile | 1905 | gb_history_file_class = HILGreenBookHistoryFile if business_type in consts.HIL_SET else AFCGreenBookHistoryFile |
1906 | ecm = ECM() | 1906 | ecm = ECM() |
1907 | response_json = ecm.search_doc_info_list(file_path, business_type) | 1907 | response_json = ecm.search_doc_info_list(file_path, business_type) |
1908 | try: | ||
1908 | data_objects = response_json['Envelope']['Body']['executeResponse']['return']['dataPackage']['DataObjects'] | 1909 | data_objects = response_json['Envelope']['Body']['executeResponse']['return']['dataPackage']['DataObjects'] |
1910 | except Exception as e: | ||
1911 | self.exception_log.exception('[SearchGBHistoryFileView] [response_json parse failed] [response_json={0}] [error={1}]'.format(response_json, traceback.format_exc())) | ||
1912 | return response.ok(data=False) | ||
1909 | self.running_log.info('[SearchGBHistoryFileView] [data_objects size={0}] '.format(len(data_objects))) | 1913 | self.running_log.info('[SearchGBHistoryFileView] [data_objects size={0}] '.format(len(data_objects))) |
1910 | for data_object in data_objects: | 1914 | for data_object in data_objects: |
1911 | object_id = data_object['Identity']['ObjectId']['@id'] | 1915 | object_id = data_object['Identity']['ObjectId']['@id'] | ... | ... |
-
Please register or sign in to post a comment