py/gadict_c5.py
changeset 399 a6a7036f3c6f
parent 394 4d45194c71b6
child 402 b47698d5ccab
--- a/py/gadict_c5.py	Sun Mar 27 22:36:19 2016 +0300
+++ b/py/gadict_c5.py	Sun Mar 27 22:43:45 2016 +0300
@@ -19,8 +19,16 @@
 
 
 parser = gadict.Parser()
-dom = parser.parse(fin)
-fin.close()
+try:
+    dom = parser.parse(fin)
+except gadict.ParseException as ex:
+    sys.stdout.write("{:s}{:s}\n".format(fgadict, repr(ex)))
+    if __debug__:
+        import traceback
+        traceback.print_exc()
+    exit(1)
+finally:
+    fin.close()
 
 for idx in range(1, len(dom)):
     article = dom[idx]