1class OpenTypeLibError(Exception): 2 def __init__(self, message, location): 3 Exception.__init__(self, message) 4 self.location = location 5 6 def __str__(self): 7 message = Exception.__str__(self) 8 if self.location: 9 return f"{self.location}: {message}" 10 else: 11 return message 12