convert listImportableContents to throwing exceptions

This commit is contained in:
Joey Hess 2020-12-22 14:20:11 -04:00
parent 5d8e4a7c74
commit e1ac42be77
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 27 additions and 27 deletions

View file

@ -550,13 +550,11 @@ renameExportS3 hv r rs info k src dest = Just <$> go
srcobject = T.pack $ bucketExportLocation info src
dstobject = T.pack $ bucketExportLocation info dest
listImportableContentsS3 :: S3HandleVar -> Remote -> S3Info -> Annex (Maybe (ImportableContents (ContentIdentifier, ByteSize)))
listImportableContentsS3 :: S3HandleVar -> Remote -> S3Info -> Annex (ImportableContents (ContentIdentifier, ByteSize))
listImportableContentsS3 hv r info =
withS3Handle hv $ \case
Nothing -> do
warning $ needS3Creds (uuid r)
return Nothing
Just h -> catchMaybeIO $ liftIO $ runResourceT $
Nothing -> giveup $ needS3Creds (uuid r)
Just h -> liftIO $ runResourceT $
extractFromResourceT =<< startlist h
where
startlist h