mirror of https://github.com/docker/docker-py.git
Merge pull request #2642 from YuviGold/feature/api-server-error-message-url
Add response url to Server Error and Client Error messages
This commit is contained in:
commit
5b60bba104
|
|
@ -46,12 +46,14 @@ class APIError(requests.exceptions.HTTPError, DockerException):
|
||||||
message = super(APIError, self).__str__()
|
message = super(APIError, self).__str__()
|
||||||
|
|
||||||
if self.is_client_error():
|
if self.is_client_error():
|
||||||
message = '{0} Client Error: {1}'.format(
|
message = '{0} Client Error for {1}: {2}'.format(
|
||||||
self.response.status_code, self.response.reason)
|
self.response.status_code, self.response.url,
|
||||||
|
self.response.reason)
|
||||||
|
|
||||||
elif self.is_server_error():
|
elif self.is_server_error():
|
||||||
message = '{0} Server Error: {1}'.format(
|
message = '{0} Server Error for {1}: {2}'.format(
|
||||||
self.response.status_code, self.response.reason)
|
self.response.status_code, self.response.url,
|
||||||
|
self.response.reason)
|
||||||
|
|
||||||
if self.explanation:
|
if self.explanation:
|
||||||
message = '{0} ("{1}")'.format(message, self.explanation)
|
message = '{0} ("{1}")'.format(message, self.explanation)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue