change retrieveExport and getKey to throw exception
retrieveExport is part of ongoing transition to make remote methods throw exceptions, rather than silently hide them. getKey very rarely fails, and when it does it's always for the same reason (user configured annex.backend to url for some reason). So, this will avoid dealing with Nothing everywhere it's used. This commit was sponsored by Ilya Shlyakhter on Patreon.
This commit is contained in:
parent
4814b444dd
commit
3334d3831b
23 changed files with 151 additions and 152 deletions
|
@ -89,10 +89,8 @@ perform file oldkey oldbackend newbackend = go =<< genkey (fastMigrate oldbacken
|
|||
, contentLocation = content
|
||||
, inodeCache = Nothing
|
||||
}
|
||||
v <- genKey source nullMeterUpdate (Just newbackend)
|
||||
return $ case v of
|
||||
Just (newkey, _) -> Just (newkey, False)
|
||||
_ -> Nothing
|
||||
newkey <- fst <$> genKey source nullMeterUpdate (Just newbackend)
|
||||
return $ Just (newkey, False)
|
||||
genkey (Just fm) = fm oldkey newbackend afile >>= \case
|
||||
Just newkey -> return (Just (newkey, True))
|
||||
Nothing -> genkey Nothing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue