We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da01ec2 commit 8366508Copy full SHA for 8366508
1 file changed
ayon_api/utils.py
@@ -188,14 +188,20 @@ def raise_for_status(self, message=None):
188
except (AttributeError, KeyError, RequestsJSONDecodeError):
189
pass
190
191
- detail = data.get("detail")
192
- if detail:
193
- message = f"{message} ({detail})"
+ submsg = ""
+ if data:
+ submsg = json.dumps(data, indent=4)
194
+
195
self.log.warning(
- "HTTP request error: %s\n%s",
196
+ "HTTP request error: %s%s%s",
197
message,
- json.dumps(data, indent=4),
198
+ "\n" if submsg else "",
199
+ submsg,
200
)
201
202
+ detail = data.get("detail")
203
+ if detail:
204
+ message = f"{message} ({detail})"
205
raise HTTPRequestError(message, exc.response)
206
207
def __enter__(self, *args, **kwargs):
0 commit comments