don't error out entirely if an url cannot be downloaded
This commit is contained in:
parent
0fada43808
commit
00340dfe49
1 changed files with 8 additions and 5 deletions
|
@ -80,11 +80,14 @@ download url file = do
|
||||||
nodownload :: String -> FilePath -> CommandPerform
|
nodownload :: String -> FilePath -> CommandPerform
|
||||||
nodownload url file = do
|
nodownload url file = do
|
||||||
(exists, size) <- liftIO $ Url.exists url
|
(exists, size) <- liftIO $ Url.exists url
|
||||||
unless exists $
|
if exists
|
||||||
error $ "unable to access url: " ++ url
|
then do
|
||||||
let key = Backend.URL.fromUrl url size
|
let key = Backend.URL.fromUrl url size
|
||||||
setUrlPresent key url
|
setUrlPresent key url
|
||||||
next $ Command.Add.cleanup file key False
|
next $ Command.Add.cleanup file key False
|
||||||
|
else do
|
||||||
|
warning $ "unable to access url: " ++ url
|
||||||
|
stop
|
||||||
|
|
||||||
url2file :: URI -> Maybe Int -> FilePath
|
url2file :: URI -> Maybe Int -> FilePath
|
||||||
url2file url pathdepth = case pathdepth of
|
url2file url pathdepth = case pathdepth of
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue