errors.py 909 B

12345678910111213141516171819202122232425262728293031323334
  1. class OperationFailedError(Exception):
  2. def __init__(self, reason):
  3. self.msg = reason
  4. class StreamParseError(RuntimeError):
  5. def __init__(self, reason):
  6. self.msg = reason
  7. class HealthCheckException(Exception):
  8. def __init__(self, reason):
  9. self.msg = reason
  10. class HealthCheckFailed(HealthCheckException):
  11. def __init__(self, container_id):
  12. super().__init__(
  13. 'Container "{}" is unhealthy.'.format(container_id)
  14. )
  15. class NoHealthCheckConfigured(HealthCheckException):
  16. def __init__(self, service_name):
  17. super().__init__(
  18. 'Service "{}" is missing a healthcheck configuration'.format(
  19. service_name
  20. )
  21. )
  22. class CompletedUnsuccessfully(Exception):
  23. def __init__(self, container_id, exit_code):
  24. self.msg = 'Container "{}" exited with code {}.'.format(container_id, exit_code)