We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca3d16d commit 50a5e72Copy full SHA for 50a5e72
scan_explorer_service/views/metadata.py
@@ -30,10 +30,17 @@ def article_extra(bibcode: str):
30
current_app.logger.debug(f'Headers: {headers}')
31
response = requests.get(ads_search_service, params, headers=headers).json()
32
current_app.logger.debug(f'Response: {response}')
33
+
34
35
+ if response.status_code == 429:
36
+ return jsonify(message='Rate limit exceeded', error=response), 429
37
38
docs = response.get('response').get('docs')
39
current_app.logger.debug(f'Docs: {docs}')
40
if docs:
41
return docs[0]
42
+ else:
43
+ return jsonify(message='No article found'), 404
44
except:
45
return jsonify(message='Failed to retrieve external ADS article metadata'), 500
46
0 commit comments