Skip to content

Commit 9d7a191

Browse files
author
Marko Mrdjenovic
committed
save details in error for possible inspection later
1 parent 63efb64 commit 9d7a191

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sparkpost/exceptions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ def __init__(self, response, *args, **kwargs):
1414
pass
1515
if not errors:
1616
errors = [response.text or ""]
17+
self.status = response.status_code
18+
self.response = response
19+
self.errors = errors
1720
message = """Call to {uri} returned {status_code}, errors:
1821
1922
{errors}

sparkpost/tornado/exceptions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ def __init__(self, response, *args, **kwargs):
1616
pass
1717
if not errors:
1818
errors = [response.body.decode("utf-8") or ""]
19+
self.status = response.code
20+
self.response = response
21+
self.errors = errors
1922
message = """Call to {uri} returned {status_code}, errors:
2023
2124
{errors}

0 commit comments

Comments
 (0)