Skip to content
Snippets Groups Projects
Commit e07569e7 authored by vuillaut's avatar vuillaut
Browse files

add test on status when getting record

parent a28c5140
No related branches found
No related tags found
1 merge request!15api
......@@ -502,5 +502,9 @@ def get_record(record_id):
:return: Record
"""
url = f"{zenodo_api_url}/records/{record_id}"
return Record(requests.get(url).json())
json = requests.get(url).json()
if 'status' in json.keys():
raise ValueError(f"Error {json['status']} : {json['message']}")
else:
return Record(json)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment