Skip to content

Commit 2030322

Browse files
committed
enhance error reporting to include server result codes.
1 parent 6eb7cf2 commit 2030322

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

umapi_client/error.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ def __init__(self, attempts, seconds, result):
2929

3030
class ServerError(Exception):
3131
def __init__(self, result):
32-
Exception.__init__(self, "Server error: " + result.text)
32+
Exception.__init__(self, "Server error ({}): ".format(result.status_code) + result.text)
3333
self.result = result
3434

3535

3636
class RequestError(Exception):
3737
def __init__(self, result):
38-
Exception.__init__(self, "Request Error: " + result.text)
38+
Exception.__init__(self, "Request Error ({}): ".format(result.status_code) + result.text)
3939
self.result = result
4040

4141

0 commit comments

Comments
 (0)