Skip to content

Commit e10f947

Browse files
committed
improve error handling
1 parent d0f8ddf commit e10f947

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

server/workers/api/src/apis/export.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ def transform2bibtex(metadata):
4444
except Exception:
4545
author = metadata.get("authors", "")
4646
doi = metadata.get("doi", "")
47-
doi = re.sub("https://|http://|dx.doi.org/|doi.org/", "", doi)
47+
try:
48+
doi = re.sub("https://|http://|dx.doi.org/|doi.org/", "", doi)
49+
except Exception:
50+
pass
4851
id = metadata.get("id", "")
4952
published_in = metadata.get("published_in", "")
5053
url = metadata.get("list_link", {}).get("address", "")

0 commit comments

Comments
 (0)