Skip to content

Commit b3c7ac4

Browse files
committed
Add details to downloader error
1 parent 49fba92 commit b3c7ac4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pyQuARC/code/downloader.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,19 @@ def download(self):
107107

108108
# gets the response, makes sure it's 200, puts it in an object variable
109109
if response.status_code != 200:
110+
message = "Something went wrong while downloading the requested metadata. Make sure all the inputs are correct."
110111
try:
111-
message = json.loads(response.text).get("errors")
112+
details = json.loads(response.text).get("errors")
112113
except (json.decoder.JSONDecodeError, KeyError):
113-
message = "Something went wrong while downloading the requested metadata. Make sure all the inputs are correct."
114+
details = "N/A"
114115
self.log_error(
115116
"request_failed",
116117
{
117118
"concept_id": self.concept_id,
118119
"url": url,
119120
"status_code": response.status_code,
120121
"message": message,
122+
"details": details,
121123
},
122124
)
123125
return

0 commit comments

Comments
 (0)