exceptions.py 622 B

1234567891011121314151617181920212223242526272829303132
  1. class FileNotExisted(Exception):
  2. def __init__(self, path):
  3. self.path = path
  4. def __str__(self):
  5. return f'File {self.path} does not exist.'
  6. class InvalidConfig(Exception):
  7. def __init__(self, msg):
  8. self.msg = msg
  9. def __str__(self):
  10. return f'Invalid config: {self.msg}'
  11. class InvalidParams(Exception):
  12. def __init__(self, msg):
  13. self.msg = msg
  14. def __str__(self):
  15. return f'Invalid params: {self.msg}'
  16. class EmptyData(Exception):
  17. def __init__(self, msg):
  18. self.msg = msg
  19. def __str__(self):
  20. return f'Empty data: {self.msg}'