diff --git a/src/sgfParser/__init__.py b/src/sgfParser/__init__.py old mode 100644 new mode 100755 --- a/src/sgfParser/__init__.py +++ b/src/sgfParser/__init__.py @@ -19,10 +19,11 @@ def strRowCol(s, i): class ParserError(Exception): def __init__(self,msg,s,i): self.msg=msg - self.row,self.col=strRowCol(s, i) + self.row,self.col=strRowCol(s,i) + self.context=s[i:i+16] def __str__(self): - return "{0} at row {1}, col {2}".format(self.msg,self.row,self.col) + return "{0} at row {1}, col {2}, got '{3}...' instead".format(self.msg,self.row,self.col,self.context) class ParserWarning(ParserError):