diff --git a/rendercv/data_model.py b/rendercv/data_model.py index da6b2262..9b321d09 100644 --- a/rendercv/data_model.py +++ b/rendercv/data_model.py @@ -961,8 +961,9 @@ def check_doi(cls, doi: str) -> str: try: urllib.request.urlopen(doi_url) - except urllib.request.HTTPError: - raise ValueError(f"{doi} cannot be found in the DOI System 🤖") + except urllib.request.HTTPError as err: + if err.code == 404: + raise ValueError(f"{doi} cannot be found in the DOI System 🤖") return doi