Skip to content

Commit a4dd001

Browse files
authored
Validate CI fix
1 parent 9e15dc6 commit a4dd001

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

5.19 KB
Binary file not shown.

bin/arxiv_to_publications_correct.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ def fetch_doi_content(url, accept_header, description):
4545
print(f'Ignoring {url}, invalid metadata response: {exc}\n\n')
4646
continue
4747

48-
if len(data['author']) > 1:
49-
id = data['author'][0]['family'] + 'EtAl' + str(data['issued']['date-parts'][0][0])
50-
else:
51-
id = data['author'][0]['family'] + str(data['issued']['date-parts'][0][0])
48+
try:
49+
if len(data['author']) > 1:
50+
id = data['author'][0]['family'] + 'EtAl' + str(data['issued']['date-parts'][0][0])
51+
else:
52+
id = data['author'][0]['family'] + str(data['issued']['date-parts'][0][0])
53+
except (KeyError, IndexError, TypeError) as exc:
54+
print(f'Ignoring {url}, incomplete metadata response: {exc}\n\n')
55+
continue
5256
id = id.replace(" ", "_")
5357

5458
entries = db.get_entry_dict()

0 commit comments

Comments
 (0)