1
0
Fork 0

Improve reporting on bad indices.

This commit is contained in:
James Turner 2017-02-27 00:16:30 +00:00
parent 493ad2c306
commit 7a64df78e3

View file

@ -185,12 +185,13 @@ class PropsHandler(handler.ContentHandler):
if 'include' in attrs.keys():
self.handleInclude(attrs['include'])
return
currentState = self._stateStack[-1]
if 'n' in attrs.keys():
try:
index = int(attrs['n'])
except:
print "Invalid index at line:", self._locator.getLineNumber(), "of", self._path
raise IndexError("Invalid index at line:", self._locator.getLineNumber(), "of", self._path)
currentState.recordExplicitIndex(name, index)