fork download
  1. class FileNotExistInDatabase(Exception):
  2. """
  3. Исключение: файл не найден в бд
  4. """
  5. def __init__ (self, *args):
  6. if args:
  7. self.message = args[0]
  8. else:
  9. self.message = None
  10.  
  11. def __str__ (self):
  12. if self.message:
  13. return f"FileNotExistInDatabase , {self.message}"
  14. else:
  15. return "FileNotExistInDatabase, has been raised"
  16.  
  17. class MergeFilesError(Exception):
  18. """
  19. Исключение: ошибка при слиянии файлов
  20. """
  21. def __init__ (self, *args):
  22. if args:
  23. self.message = args[0]
  24. else:
  25. self.message = None
  26.  
  27. def __str__ (self):
  28. if self.message:
  29. return f"MergeFilesError, {self.message}"
  30. else:
  31. return "MergeFilesError, has been raised"
Success #stdin #stdout 0.11s 14124KB
stdin
Standard input is empty
stdout
Standard output is empty