Skip to content

Commit a257d9b

Browse files
committed
try to avoid errors being automatically raised when they should be handled according to the error handling settings
1 parent 1280f77 commit a257d9b

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

fairgraph/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,10 @@ def delete_instance(self, instance_id: str, ignore_not_found: bool = True, ignor
530530
"""
531531
Delete a KG instance.
532532
"""
533-
UUID(instance_id)
533+
if isinstance(instance_id, UUID):
534+
instance_id = str(instance_id)
535+
else:
536+
UUID(instance_id)
534537
response = self._kg_client.instances.delete(instance_id)
535538
# response is None if no errors
536539
if response: # error

fairgraph/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def _normalize_type(data_item):
374374
else:
375375
try:
376376
value = prop.deserialize(data_item)
377-
except ValueError as err:
377+
except (TypeError, ValueError, AssertionError) as err:
378378
ErrorHandling.handle_violation(cls.error_handling, str(err))
379379
else:
380380
if isinstance(value, Link) and value.allowed_types is not None:

0 commit comments

Comments
 (0)