mirror of https://github.com/eyhc1/rendercv.git
Raise error only if status code is 404
This commit is contained in:
parent
270479857d
commit
19d9036ce9
|
@ -961,8 +961,9 @@ class PublicationEntry(Event):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen(doi_url)
|
urllib.request.urlopen(doi_url)
|
||||||
except urllib.request.HTTPError:
|
except urllib.request.HTTPError as err:
|
||||||
raise ValueError(f"{doi} cannot be found in the DOI System 🤖")
|
if err.code == 404:
|
||||||
|
raise ValueError(f"{doi} cannot be found in the DOI System 🤖")
|
||||||
|
|
||||||
return doi
|
return doi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue