Skip to content

Commit 5ffb743

Browse files
committed
[tools/xmlparser.py] Object Creation Errors to Warnings in Save Mode
If ignore_errors is set, errors from object creation are converted to warnings. Related to issue #276.
1 parent ae2474d commit 5ffb743

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

odml/tools/xmlparser.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,12 @@ def parse_tag(self, root, fmt, insert_children=True):
310310
self.check_mandatory_arguments(check_args, fmt, root.tag, root)
311311

312312
# Instantiate the current odML object with the parsed attributes.
313-
obj = fmt.create(**arguments)
313+
# Return None, if
314+
obj = None
315+
try:
316+
obj = fmt.create(**arguments)
317+
except Exception as e:
318+
self.error(str(e), root)
314319

315320
if insert_children:
316321
for child in children:

0 commit comments

Comments
 (0)