33a3d92e by 冯轩

ADD:try catch

1 parent 30dda232
......@@ -1905,7 +1905,11 @@ class SearchGBHistoryFileView(GenericView):
gb_history_file_class = HILGreenBookHistoryFile if business_type in consts.HIL_SET else AFCGreenBookHistoryFile
ecm = ECM()
response_json = ecm.search_doc_info_list(file_path, business_type)
data_objects = response_json['Envelope']['Body']['executeResponse']['return']['dataPackage']['DataObjects']
try:
data_objects = response_json['Envelope']['Body']['executeResponse']['return']['dataPackage']['DataObjects']
except Exception as e:
self.exception_log.exception('[SearchGBHistoryFileView] [response_json parse failed] [response_json={0}] [error={1}]'.format(response_json, traceback.format_exc()))
return response.ok(data=False)
self.running_log.info('[SearchGBHistoryFileView] [data_objects size={0}] '.format(len(data_objects)))
for data_object in data_objects:
object_id = data_object['Identity']['ObjectId']['@id']
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!