Skip to content

Commit

Permalink
Trying to have better error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
SNoiraud authored and Nick-Hall committed Apr 16, 2024
1 parent e913d93 commit 4ecc854
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions gramps/plugins/webreport/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,12 @@ def list_people_changed(self, object_type):

def sort_on_change(handle):
"""sort records based on the last change time"""
obj = fct(handle)
timestamp = obj.get_change_time()
try:
obj = fct(handle)
timestamp = obj.get_change_time()
except exception:
print("In sort :", handle, " not found for", object_type)
timestamp = 0
return timestamp

if object_type == Person:
Expand Down Expand Up @@ -323,7 +327,11 @@ def sort_on_change(handle):
for handle in obj_list:
date = obj = None
name = ""
obj = fct(handle)
try:
obj = fct(handle)
except exception:
print("Handle not found:", handle, " not found for", object_type)
continue
if object_type == Person:
name = fct_link(handle)
elif object_type == Family:
Expand Down

0 comments on commit 4ecc854

Please sign in to comment.