errors.py 860 B

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