We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebdd121 commit 1fc8f19Copy full SHA for 1fc8f19
repo2docker/contentproviders/doi.py
@@ -51,9 +51,15 @@ def doi2url(self, doi):
51
try:
52
resp = self._request(f"https://doi.org/{doi}")
53
resp.raise_for_status()
54
- # If the DOI doesn't resolve, just return URL
55
- except HTTPError:
56
- return doi
+ except HTTPError as e:
+ # If the DOI doesn't exist, just return URL
+ if e.response.status_code == 404:
57
+ return doi
58
+ # Reraise any other errors because if the DOI service is down (or
59
+ # we hit a rate limit) we don't want to silently continue to the
60
+ # default Git provider as this leads to a misleading error.
61
+ logging.error(f"DOI {doi} does not resolve: {e}")
62
+ raise
63
return resp.url
64
else:
65
# Just return what is actulally just a URL
0 commit comments