1*e1fe3e4aSElliott Hughesclass VoltLibError(Exception): 2*e1fe3e4aSElliott Hughes def __init__(self, message, location): 3*e1fe3e4aSElliott Hughes Exception.__init__(self, message) 4*e1fe3e4aSElliott Hughes self.location = location 5*e1fe3e4aSElliott Hughes 6*e1fe3e4aSElliott Hughes def __str__(self): 7*e1fe3e4aSElliott Hughes message = Exception.__str__(self) 8*e1fe3e4aSElliott Hughes if self.location: 9*e1fe3e4aSElliott Hughes path, line, column = self.location 10*e1fe3e4aSElliott Hughes return "%s:%d:%d: %s" % (path, line, column, message) 11*e1fe3e4aSElliott Hughes else: 12*e1fe3e4aSElliott Hughes return message 13