add an OverlordAPIError

This commit is contained in:
Russell Haering
2014-01-16 18:32:15 -08:00
parent f6178f6118
commit 8eb89e73de

View File

@@ -53,14 +53,23 @@ class RequestedObjectNotFoundError(errors.NotFound):
self.details = details self.details = details
class HeartbeatError(errors.RESTError): class OverlordAPIError(errors.RESTError):
"""Error raised when a call to the agent API fails."""
message = 'Error in call to teeth-agent-api.'
def __init__(self, details):
super(OverlordAPIError, self).__init__(details)
self.details = details
class HeartbeatError(OverlordAPIError):
"""Error raised when a heartbeat to the agent API fails.""" """Error raised when a heartbeat to the agent API fails."""
message = 'Error heartbeating to agent API.' message = 'Error heartbeating to agent API.'
def __init__(self, details): def __init__(self, details):
super(HeartbeatError, self).__init__() super(HeartbeatError, self).__init__(details)
self.details = details
class ImageDownloadError(errors.RESTError): class ImageDownloadError(errors.RESTError):