error.py 335 B

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