diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2022-04-18 17:27:12 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2022-04-18 17:27:12 -0700 |
commit | c34621b634df82dcc66f1ddeafb40fbe7eab1118 (patch) | |
tree | 9e482b797935e0d0f639fbdee86b26b4c82325c5 /python/fatcat_web | |
parent | 5c7443e38281f9064c3961f675a228024947acbf (diff) | |
download | fatcat-c34621b634df82dcc66f1ddeafb40fbe7eab1118.tar.gz fatcat-c34621b634df82dcc66f1ddeafb40fbe7eab1118.zip |
web: partially handle CSL author missing path
Diffstat (limited to 'python/fatcat_web')
-rw-r--r-- | python/fatcat_web/routes.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index 1f6602d4..e2c90d52 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -3,6 +3,7 @@ import os from typing import Any, Callable, Dict, List, Optional import citeproc_styles +import sentry_sdk from fatcat_openapi_client import EditgroupAnnotation from fatcat_openapi_client.rest import ApiException, ApiValueError from flask import ( @@ -1468,7 +1469,14 @@ def release_citeproc(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(500, e) try: cite = citeproc_csl(csl, style, is_html) except citeproc_styles.StyleNotFoundError as e: |