From 2a750922575bccc89dec1188613bfc60a98dba49 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 Nov 2014 12:42:12 -0400 Subject: support S3 front-end used by globalways.net This threw an unusual exception w/o an error message when probing to see if the bucket exists yet. So rather than relying on tryS3, catch all exceptions. This does mean that it might get an exception for some transient network error, think this means the bucket DNE yet, and try to create it, and then fail when it already exists. --- Remote/S3.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Remote') diff --git a/Remote/S3.hs b/Remote/S3.hs index e0ff93bb3..844d87902 100644 --- a/Remote/S3.hs +++ b/Remote/S3.hs @@ -299,7 +299,7 @@ genBucket c u = do where go _ (Right True) = noop go h _ = do - v <- tryS3 $ sendS3Handle h (S3.getBucket $ bucket $ hinfo h) + v <- tryNonAsync $ sendS3Handle h (S3.getBucket $ bucket $ hinfo h) case v of Right _ -> noop Left _ -> do @@ -323,9 +323,8 @@ writeUUIDFile :: RemoteConfig -> UUID -> S3Handle -> Annex () writeUUIDFile c u h = do v <- checkUUIDFile c u h case v of - Left e -> throwM e Right True -> noop - Right False -> void $ sendS3Handle h mkobject + _ -> void $ sendS3Handle h mkobject where file = T.pack $ uuidFile c uuidb = L.fromChunks [T.encodeUtf8 $ T.pack $ fromUUID u] -- cgit v1.2.3