convert removeExportDirectory to throw exception
Part of ongoing transition to make remote methods throw exceptions, rather than silently hide them. This commit was sponsored by Ilya Shlyakhter on Patreon.
This commit is contained in:
parent
0a9a3ed1c3
commit
037440ef36
9 changed files with 38 additions and 52 deletions
|
@ -59,8 +59,8 @@ readonlyStoreExport _ _ _ _ = readonlyFail
|
|||
readonlyRemoveExport :: Key -> ExportLocation -> Annex ()
|
||||
readonlyRemoveExport _ _ = readonlyFail
|
||||
|
||||
readonlyRemoveExportDirectory :: ExportDirectory -> Annex Bool
|
||||
readonlyRemoveExportDirectory _ = readonlyFail'
|
||||
readonlyRemoveExportDirectory :: ExportDirectory -> Annex ()
|
||||
readonlyRemoveExportDirectory _ = readonlyFail
|
||||
|
||||
readonlyRenameExport :: Key -> ExportLocation -> ExportLocation -> Annex (Maybe Bool)
|
||||
readonlyRenameExport _ _ _ = return Nothing
|
||||
|
@ -74,10 +74,5 @@ readonlyRemoveExportWithContentIdentifier _ _ _ = readonlyFail
|
|||
readonlyFail :: Annex a
|
||||
readonlyFail = giveup readonlyWarning
|
||||
|
||||
readonlyFail' :: Annex Bool
|
||||
readonlyFail' = do
|
||||
warning readonlyWarning
|
||||
return False
|
||||
|
||||
readonlyWarning :: String
|
||||
readonlyWarning = "this remote is readonly"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue