improve error display when storing to an export/import remote fails
Prompted by the test suite on windows failing to with "export foo failed" and no information about what went wrong. Note that only storeExportWithContentIdentifier has been converted. storeExport still returns a Bool and so exceptions may be hidden. However, storeExportWithContentIdentifier has many more failure modes, since it needs to avoid overwriting modified files. So it's more important it have better error display.
This commit is contained in:
parent
05d52f9699
commit
5004381dd9
6 changed files with 37 additions and 33 deletions
|
@ -65,18 +65,17 @@ readonlyRemoveExportDirectory _ = readonlyFail
|
|||
readonlyRenameExport :: Key -> ExportLocation -> ExportLocation -> Annex (Maybe Bool)
|
||||
readonlyRenameExport _ _ _ = return Nothing
|
||||
|
||||
readonlyStoreExportWithContentIdentifier :: FilePath -> Key -> ExportLocation -> [ContentIdentifier] -> MeterUpdate -> Annex (Maybe ContentIdentifier)
|
||||
readonlyStoreExportWithContentIdentifier _ _ _ _ _ = do
|
||||
readonlyWarning
|
||||
return Nothing
|
||||
readonlyStoreExportWithContentIdentifier :: FilePath -> Key -> ExportLocation -> [ContentIdentifier] -> MeterUpdate -> Annex (Either String ContentIdentifier)
|
||||
readonlyStoreExportWithContentIdentifier _ _ _ _ _ =
|
||||
return $ Left readonlyWarning
|
||||
|
||||
readonlyRemoveExportWithContentIdentifier :: Key -> ExportLocation -> [ContentIdentifier] -> Annex Bool
|
||||
readonlyRemoveExportWithContentIdentifier _ _ _ = readonlyFail
|
||||
|
||||
readonlyFail :: Annex Bool
|
||||
readonlyFail = do
|
||||
readonlyWarning
|
||||
warning readonlyWarning
|
||||
return False
|
||||
|
||||
readonlyWarning :: Annex ()
|
||||
readonlyWarning = warning "this remote is readonly"
|
||||
readonlyWarning :: String
|
||||
readonlyWarning = "this remote is readonly"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue