Skip to content

Commit

Permalink
Correctly process the return status of PutObject and DeleteObject.
Browse files Browse the repository at this point in the history
Previously the AWS S3 response was ignored.  Now we check if the
response was successful or not.
  • Loading branch information
meteficha committed Jan 5, 2012
1 parent c7826b7 commit fe41ff3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Aws/S3/Commands/DeleteObject.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Aws.S3.Info
import Aws.S3.Metadata
import Aws.S3.Model
import Aws.S3.Query
import Aws.S3.Response
import Aws.Signature
import Aws.Transaction
import Data.ByteString.Char8 ({- IsString -})
Expand Down Expand Up @@ -36,7 +37,8 @@ instance SignQuery DeleteObject where

instance ResponseConsumer DeleteObject DeleteObjectResponse where
type ResponseMetadata DeleteObjectResponse = S3Metadata
responseConsumer _ _ _ _ _ = return DeleteObjectResponse
responseConsumer _ = s3ResponseConsumer $ \_ _ _ ->
return DeleteObjectResponse


instance Transaction DeleteObject DeleteObjectResponse
Expand Down
4 changes: 3 additions & 1 deletion Aws/S3/Commands/PutObject.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Aws.S3.Info
import Aws.S3.Metadata
import Aws.S3.Model
import Aws.S3.Query
import Aws.S3.Response
import Aws.Signature
import Aws.Transaction
import Control.Applicative
Expand Down Expand Up @@ -65,7 +66,8 @@ instance SignQuery PutObject where

instance ResponseConsumer PutObject PutObjectResponse where
type ResponseMetadata PutObjectResponse = S3Metadata
responseConsumer _ _ _ _ _ = do return $ PutObjectResponse Nothing
responseConsumer _ = s3ResponseConsumer $ \_ _ _ ->
return $ PutObjectResponse Nothing

This comment has been minimized.

Copy link
@meteficha

meteficha Jan 6, 2012

Author Collaborator

Shouldn't we parse the object version from the response instead of just blindly returning Nothing?

This comment has been minimized.

Copy link
@aristidb

aristidb Jan 6, 2012

Owner

I presume this was quickly hacked together and the author didn't need that field. But yes. If you need it, or want to take care of it, do so. Otherwise, I'll look at it at a later date.


instance Transaction PutObject PutObjectResponse

0 comments on commit fe41ff3

Please sign in to comment.