Skip to content

Commit e430603

Browse files
committed
Add response_reason to SparkApiError descriptions
Add the `response.reason` (if present) to the `SparkApiError` description.
1 parent 13128e2 commit e430603

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ciscosparkapi/exceptions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,14 @@ def __init__(self, response):
128128

129129
# Error message
130130
response_code = response.status_code
131+
response_reason = " " + response.reason if response.reason else ""
131132
description = SPARK_RESPONSE_CODES.get(response_code,
132133
"Unknown Response Code")
133134
detail = response_to_string(response)
134135

135-
super(SparkApiError, self).__init__("Response Code [{}] - {}\n{}"
136+
super(SparkApiError, self).__init__("Response Code [{}]{} - {}\n{}"
136137
"".format(response_code,
138+
response_reason,
137139
description,
138140
detail))
139141

0 commit comments

Comments
 (0)