Skip to content

Commit 3766f77

Browse files
author
Yuval Goldberg
committed
Add response url to Server Error and Client Error messages
Signed-off-by: Yuval Goldberg <[email protected]>
1 parent 30ff9f3 commit 3766f77

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docker/errors.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ def __str__(self):
4646
message = super(APIError, self).__str__()
4747

4848
if self.is_client_error():
49-
message = '{0} Client Error: {1}'.format(
50-
self.response.status_code, self.response.reason)
49+
message = '{0} Client Error for {1}: {2}'.format(
50+
self.response.status_code, self.response.url,
51+
self.response.reason)
5152

5253
elif self.is_server_error():
53-
message = '{0} Server Error: {1}'.format(
54-
self.response.status_code, self.response.reason)
54+
message = '{0} Server Error for {1}: {2}'.format(
55+
self.response.status_code, self.response.url,
56+
self.response.reason)
5557

5658
if self.explanation:
5759
message = '{0} ("{1}")'.format(message, self.explanation)

0 commit comments

Comments
 (0)