avoid showing error when copy fails

Since renameExport is allowed to fail for any reason, and its failure is
always recovered from by doing a new upload and deleting the old
content, this avoids unnecessary noise.

Copying a file on the IA failed, apparently something wrong with their
emulation of S3:

  S3Error {s3StatusCode = Status {statusCode = 400, statusMessage = "Bad Request"}, s3ErrorCode = "InvalidArgument", s3ErrorMessage = "Invalid Argument", s3ErrorResource = Just "x-(amz|archive)-copy-source header is bad: 'joeyh-public-test2/foo'", s3ErrorHostId = Nothing, s3ErrorAccessKeyId = Nothing, s3ErrorStringToSign = Nothing, s3ErrorBucket = Nothing, s3ErrorEndpointRaw = Nothing, s3ErrorEndpoint = Nothing}

This commit was sponsored by Jake Vosloo on Patreon.
This commit is contained in:
Joey Hess 2017-09-12 12:42:44 -04:00
parent 267f47c473
commit da23dec7d3
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -362,7 +362,7 @@ checkPresentExportS3 r info _k loc =
-- S3 has no move primitive; copy and delete.
renameExportS3 :: Remote -> S3Info -> Key -> ExportLocation -> ExportLocation -> Annex Bool
renameExportS3 r info _k src dest = catchNonAsync go (\e -> warning (show e) >> return False)
renameExportS3 r info _k src dest = catchNonAsync go (\_ -> return False)
where
go = withS3Handle (config r) (gitconfig r) (uuid r) $ \h -> do
let co = S3.copyObject (bucket info) dstobject