Skip to content

Commit

Permalink
Merge pull request datalad#7648 from yarikoptic/enh-checkurl
Browse files Browse the repository at this point in the history
Provide detail on why CHECKURL failed for datalad and archive special remotes (would require new AnnexRemote release (above 1.6.5) to take advantage of this PR)
  • Loading branch information
yarikoptic authored Sep 10, 2024
2 parents f71ff4f + 2aaf68e commit b55d8b7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions changelog.d/pr-7648.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### 🐛 Bug Fixes

- Provide detail on why CHECKURL failed for datalad and archive special remotes (would require new AnnexRemote release (above 1.6.5) to take advantage of this PR). [PR #7648](https://github.com/datalad/datalad/pull/7648) (by [@yarikoptic](https://github.com/yarikoptic))
2 changes: 1 addition & 1 deletion datalad/customremotes/archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def checkurl(self, url):
else:
# TODO: theoretically we should first check if key is available
# from any remote to know if file is available
return False
raise RemoteError(f"archive key {akey} is not available locally.")

def checkpresent(self, key):
# TODO: so we need to maintain mapping from urls to keys. Then
Expand Down
9 changes: 4 additions & 5 deletions datalad/customremotes/datalad.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@
import logging
from urllib.parse import urlparse

from datalad.customremotes import RemoteError
from datalad.customremotes.base import AnnexCustomRemote
from datalad.customremotes.main import main as super_main
from datalad.downloaders.providers import Providers
from datalad.support.exceptions import (
CapturedException,
TargetFileAbsent,
)
from datalad.utils import unique

from datalad.customremotes import RemoteError
from datalad.customremotes.base import AnnexCustomRemote
from datalad.customremotes.main import main as super_main

lgr = logging.getLogger('datalad.customremotes.datalad')


Expand Down Expand Up @@ -72,7 +71,7 @@ def checkurl(self, url):
except Exception as exc:
ce = CapturedException(exc)
self.message("Failed to check url %s: %s" % (url, ce))
return False
raise RemoteError(str(ce))

def checkpresent(self, key):
resp = None
Expand Down

0 comments on commit b55d8b7

Please sign in to comment.