convert renameExport to throw exception

Finishes the transition to make remote methods throw exceptions, rather
than silently hide them.

A bit on the fence about this one, because when renameExport fails,
it falls back to deleting instead, and so does the user care why it failed?

However, it did let me clean up several places in the code.

This commit was sponsored by Ethan Aubin.
This commit is contained in:
Joey Hess 2020-05-15 15:05:52 -04:00
parent 00448349de
commit 6361074174
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
11 changed files with 64 additions and 89 deletions

View file

@ -258,9 +258,12 @@ data ExportActions a = ExportActions
-- Throws an exception if the remote cannot be accessed.
, checkPresentExport :: Key -> ExportLocation -> a Bool
-- Renames an already exported file.
-- This may fail with False, if the file doesn't exist.
--
-- If the remote does not support renames, it can return Nothing.
, renameExport :: Key -> ExportLocation -> ExportLocation -> a (Maybe Bool)
--
-- Throws an exception if the remote cannot be accessed, or
-- the file doesn't exist or cannot be renamed.
, renameExport :: Key -> ExportLocation -> ExportLocation -> a (Maybe ())
}
data ImportActions a = ImportActions