Skip to content

Commit 8f18f02

Browse files
committed
[xmlparser.py] Catch ValueError at Object Creation
Add more Specific Error Message. Related to issue #276.
1 parent b209dc0 commit 8f18f02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

odml/tools/xmlparser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ def parse_tag(self, root, fmt, insert_children=True):
314314
obj = fmt.create()
315315
try:
316316
obj = fmt.create(**arguments)
317-
except Exception as e:
318-
self.error(str(e), root)
317+
except ValueError:
318+
self.error("ValueError: Values '%s' do not match given DType '%s'!" % (arguments['values'], arguments['dtype']), root)
319319

320320
if insert_children:
321321
for child in children:

0 commit comments

Comments
 (0)