diff options
author | Yuval Goldberg <yuvigoldi@hotmail.com> | 2020-08-16 18:54:14 +0300 |
---|---|---|
committer | YuvalG <yuvigoldi@hotmail.com> | 2020-10-17 03:43:11 +0300 |
commit | 3766f77c20e1e14d5ad49bdcf7314f3f8459927d (patch) | |
tree | c7111f02e5bed41fe439b8bfc16eae8c9710d602 /docker/errors.py | |
parent | 30ff9f339cfb15ea00d0c6b1b3b675de3c80e8dd (diff) | |
download | docker-py-3766f77c20e1e14d5ad49bdcf7314f3f8459927d.tar.gz |
Add response url to Server Error and Client Error messages
Signed-off-by: Yuval Goldberg <yuvigoldi@hotmail.com>
Diffstat (limited to 'docker/errors.py')
-rw-r--r-- | docker/errors.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docker/errors.py b/docker/errors.py index e5d07a5..ab30a29 100644 --- a/docker/errors.py +++ b/docker/errors.py @@ -46,12 +46,14 @@ class APIError(requests.exceptions.HTTPError, DockerException): message = super(APIError, self).__str__() if self.is_client_error(): - message = '{0} Client Error: {1}'.format( - self.response.status_code, self.response.reason) + message = '{0} Client Error for {1}: {2}'.format( + self.response.status_code, self.response.url, + self.response.reason) elif self.is_server_error(): - message = '{0} Server Error: {1}'.format( - self.response.status_code, self.response.reason) + message = '{0} Server Error for {1}: {2}'.format( + self.response.status_code, self.response.url, + self.response.reason) if self.explanation: message = '{0} ("{1}")'.format(message, self.explanation) |