summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-10-25 08:49:26 +0300
committerAndrei Karas <akaras@inbox.ru>2019-11-14 02:11:20 +0300
commit780ac037168025ec18a7c7d7db8b0815d25c8760 (patch)
tree5fc31cfb3cfa995cc5f42ee06e527c21aec1190a /tools
parent4c14dc664ad4eda7ee5af8e286282e814be11ce7 (diff)
downloadhercules-780ac037168025ec18a7c7d7db8b0815d25c8760.tar.gz
hercules-780ac037168025ec18a7c7d7db8b0815d25c8760.tar.bz2
hercules-780ac037168025ec18a7c7d7db8b0815d25c8760.tar.xz
hercules-780ac037168025ec18a7c7d7db8b0815d25c8760.zip
Add information about parsing error into libconf.py
Diffstat (limited to 'tools')
-rwxr-xr-x[-rw-r--r--]tools/mobskilldbconverter.py0
-rw-r--r--tools/utils/libconf.py11
2 files changed, 9 insertions, 2 deletions
diff --git a/tools/mobskilldbconverter.py b/tools/mobskilldbconverter.py
index 4ba042062..4ba042062 100644..100755
--- a/tools/mobskilldbconverter.py
+++ b/tools/mobskilldbconverter.py
diff --git a/tools/utils/libconf.py b/tools/utils/libconf.py
index 635efd07d..7f9d6de90 100644
--- a/tools/utils/libconf.py
+++ b/tools/utils/libconf.py
@@ -226,8 +226,15 @@ class Tokenizer:
for cls, type, regex in self.token_map:
m = regex.match(string, pos=pos)
if m:
- yield cls(type, m.group(0),
- self.filename, self.row, self.column)
+ try:
+ yield cls(type, m.group(0),
+ self.filename, self.row, self.column)
+ except ValueError as e:
+ print("Error parsing file "
+ "{0}, in line:\n{1}\n{2}".format(self.filename,
+ m.group(0),
+ self.row))
+ raise
self.column += len(m.group(0))
pos = m.end()
break