aboutsummaryrefslogtreecommitdiff
path: root/Remote/S3.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-11-05 12:42:12 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-11-05 12:42:12 -0400
commit2a750922575bccc89dec1188613bfc60a98dba49 (patch)
treedc436b32e66021d6c7dec7d4b17b1c1b736d77ca /Remote/S3.hs
parentdb37da9fe71462e8d30db1578d27b701fa74857c (diff)
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.
Diffstat (limited to 'Remote/S3.hs')
-rw-r--r--Remote/S3.hs5
1 files changed, 2 insertions, 3 deletions
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]