Obvious/canoe — pull request #23 by evansolomon (2014-01-03 20:26:39+00:00)
Title: Handle inconsistent type validation in s3.uploadPart()

Hello @evansolomon,

Please review the following commits I made in branch 'bugfix/22'.

61298f3db480df3ce2f1779fd04f316ed5fa6e01 (2014-01-03 12:22:41 -0800)
Handle inconsistent type validation in s3.uploadPart()
The AWS SDK has had different type validation for the PartNumber
param in different versions. Since Canoe doesn't have a reference to
the root AWS object it has no way to tell what version is being used.

To handle the different behavior we can check the errors the SDK
responds with and sometimes guess our way into a successful second
attempt. If the second attempt fails, then we'll give up and bubble
the error up as usual.

Because this introduces a case where we may attempt the "same" upload
multiple times, there's a chance it introduces a race condition when
multiple concurrent uploads are allowed. To be safe, I'm removing the
ability to upload more than one part at a time. I'll revert that
change if/when I'm sure that there's no race condition.

Fixes #22

R=@evansolomon