Skip to content

Commit

Permalink
Merge pull request #4817 from kyleam/download-url-widen-exception
Browse files Browse the repository at this point in the history
BF: download-url: Widen exception around add_url_to_file call
  • Loading branch information
yarikoptic committed Aug 12, 2020
2 parents b302a7e + 68f8ca5 commit 58cd9bf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions datalad/interface/download_url.py
Expand Up @@ -30,10 +30,13 @@
from ..distribution.dataset import require_dataset
from ..distribution.dataset import resolve_path
from ..dochelpers import exc_str
from ..support.annexrepo import AnnexRepo, AnnexBatchCommandError
from ..support.annexrepo import AnnexRepo
from ..support.param import Parameter
from ..support.constraints import EnsureStr, EnsureNone
from ..support.exceptions import NoDatasetFound
from ..support.exceptions import (
CommandError,
NoDatasetFound,
)

from logging import getLogger
lgr = getLogger('datalad.api.download-url')
Expand Down Expand Up @@ -243,7 +246,7 @@ def __call__(urls, dataset=None, path=None, overwrite=False,
batch=len(annex_paths) > 1,
# bypass URL size check, we already have the file
options=['--relaxed'])
except AnnexBatchCommandError as exc:
except CommandError as exc:
lgr.warning("Registering %s with %s failed: %s",
path, url, exc_str(exc))

Expand Down

0 comments on commit 58cd9bf

Please sign in to comment.