aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-04-26 15:56:05 -0700
committerBryan Newbold <bnewbold@robocracy.org>2022-04-26 15:56:05 -0700
commitaff3f40a5177dd6de4eee8ea7bca78df7a595bf3 (patch)
treec72a88008743d757f70bbdb1811662336a6006af /python
parentebd92125128838e0933f538b03a8098a2c7794ba (diff)
downloadfatcat-aff3f40a5177dd6de4eee8ea7bca78df7a595bf3.tar.gz
fatcat-aff3f40a5177dd6de4eee8ea7bca78df7a595bf3.zip
citeproc: also check/protect the bibtext fetch path
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_web/routes.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py
index b790b807..4ceeac49 100644
--- a/python/fatcat_web/routes.py
+++ b/python/fatcat_web/routes.py
@@ -1451,7 +1451,14 @@ def release_bibtex(ident: str) -> AnyResponse:
entity = api.get_release(ident)
except ApiException as ae:
raise ae
- csl = release_to_csl(entity)
+ try:
+ csl = release_to_csl(entity)
+ except ValueError as e:
+ # "handle" the missing author/surname path, so we don't get exception
+ # reports about it. these are not linked to, only show up from bots.
+ sentry_sdk.set_level("warning")
+ sentry_sdk.capture_exception(e)
+ abort(400, e)
bibtex = citeproc_csl(csl, "bibtex")
return Response(bibtex, mimetype="text/plain")