Commit 232d4961 authored by Merret Buurman's avatar Merret Buurman
Browse files

Catch error if child handle record cannot be retrieved.

parent a712e35e
......@@ -303,10 +303,22 @@ def _get_list_of_parts_records_from_record(record):
list_to_be_returned = []
any_replaced = False
for handle in list_of_parts_handles:
info, replaced = _extract_info_on_one_part_record(handle)
list_to_be_returned.append(info)
if replaced:
any_replaced = True
try:
info, replaced = _extract_info_on_one_part_record(handle)
list_to_be_returned.append(info)
if replaced:
any_replaced = True
except ValueError:
# If we cannot access the child record, do not
# append anything, just leave this one out.
pass
# If no child handle record could be retrieved, but there is children,
# return None to show that something went wrong.
if len(list_to_be_returned) == 0 and len(list_of_parts_handles) > 0:
list_to_be_returned = None
any_replaced = None
return list_to_be_returned, any_replaced
def _extract_info_on_one_part_record(handle):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment