Skip to content

Commit

Permalink
Provide detail on why CHECKURL failed for datalad and archive special…
Browse files Browse the repository at this point in the history
… remotes

Inspired by

- datalad/datalad-container#267

but to be of benefit, requires review/merge/release of

- Lykos153/AnnexRemote#106

But should be safe otherwise since ATM (without the above PR) AnnexRemote simply ignores the message
  • Loading branch information
yarikoptic committed Aug 29, 2024
1 parent d4ce9ce commit 23e67d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
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 23e67d0

Please sign in to comment.