DB-API: ignore errors on secondary field lookups
This commit is contained in:
parent
3b0e04fb78
commit
0ce1a91dec
@ -37,6 +37,7 @@ import time
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .baseobj import BaseObject
|
from .baseobj import BaseObject
|
||||||
|
from gramps.gen.errors import HandleError
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -353,7 +354,13 @@ class TableObject(BaseObject):
|
|||||||
# start over here:
|
# start over here:
|
||||||
obj = None
|
obj = None
|
||||||
if current:
|
if current:
|
||||||
|
try:
|
||||||
obj = ptype.join(db, current)
|
obj = ptype.join(db, current)
|
||||||
|
except HandleError:
|
||||||
|
if ignore_errors:
|
||||||
|
obj = None
|
||||||
|
else:
|
||||||
|
raise
|
||||||
if part == "self":
|
if part == "self":
|
||||||
current = obj
|
current = obj
|
||||||
path_to = []
|
path_to = []
|
||||||
|
Loading…
Reference in New Issue
Block a user