From aff3f40a5177dd6de4eee8ea7bca78df7a595bf3 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 26 Apr 2022 15:56:05 -0700 Subject: citeproc: also check/protect the bibtext fetch path --- python/fatcat_web/routes.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'python') 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") -- cgit v1.2.3