Skip to contents

Small, centralised wrappers around [downloader::download()] used by atlas loaders. They replace ad-hoc `tryCatch(..., error = function(e) NULL)` blocks that silently hid failures, and instead produce typed, informative conditions via [cli::cli_abort()].

Two entry points are provided:

* [.neuroatlas_download()] — hard download: throws `neuroatlas_error_download` on failure. Use this when the caller cannot recover from a missing file. * [.neuroatlas_try_download()] — soft download: returns a small list describing the outcome (path, success, error, lfs_pointer). Use this when the caller wants to implement a fallback strategy.

Both helpers detect Git LFS/git-annex pointer files (small text stubs) and treat them as failure modes, so loaders don't silently accept a stub in place of the real NIfTI.