HTTPError should contain 'retry_after' parameter
'retry_after' may be passed as a parameter to create HTTPError object, so add it to HTTPError parameter list. Change-Id: Ia42b6b2e769ecd8cc2038a5a6384651cfa22c345 Closes-bug: #1524211
This commit is contained in:
parent
3f12f9e562
commit
37548eed4f
@ -69,7 +69,8 @@ class HttpError(base.ClientException):
|
||||
|
||||
def __init__(self, message=None, details=None,
|
||||
response=None, request_id=None,
|
||||
url=None, method=None, http_status=None):
|
||||
url=None, method=None, http_status=None,
|
||||
retry_after=0):
|
||||
self.http_status = http_status or self.http_status
|
||||
self.message = message or self.message
|
||||
self.details = details
|
||||
@ -78,6 +79,7 @@ class HttpError(base.ClientException):
|
||||
self.url = url
|
||||
self.method = method
|
||||
formatted_string = "%s (HTTP %s)" % (self.message, self.http_status)
|
||||
self.retry_after = retry_after
|
||||
if request_id:
|
||||
formatted_string += " (Request-ID: %s)" % request_id
|
||||
super(HttpError, self).__init__(formatted_string)
|
||||
|
Loading…
x
Reference in New Issue
Block a user