errors.py 734 B

1234567891011121314151617181920212223242526272829
  1. # Use of this source code is governed by a BSD-style
  2. # license that can be found in the LICENSE file.
  3. # Copyright 2019 The OSArchiver Authors. All rights reserved.
  4. """
  5. OSArchiver exceptions base class
  6. """
  7. class OSArchiverException(Exception):
  8. """
  9. OSArchiver base exception class
  10. """
  11. def __init__(self, message=None):
  12. """
  13. Instance the exception base class
  14. """
  15. super().__init__(message)
  16. self.message = message
  17. def __str__(self):
  18. return self.message
  19. class OSArchiverArchivingFailed(OSArchiverException):
  20. """
  21. Exception raised when archiving fail
  22. """
  23. def __init__(self, message=None):
  24. super().__init__(message='Archiving of data set failed')