Permalink
Browse files

Try to abort MultiPart upload on all errors

  • Loading branch information...
1 parent 57da4c6 commit 07ed77070fc2bf36c8df8fc06e32e8ff71ed01e2 @mludvig mludvig committed Jan 5, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 S3/MultiPart.py
View
@@ -58,10 +58,10 @@ def upload_all_parts(self):
}
try:
self.upload_part(seq, offset, current_chunk_size, labels)
- except S3UploadError, e:
- error(u"Upload of '%s' part %d failed too many times. Aborting multipart upload." % (self.file.name, seq))
+ except:
+ error(u"Upload of '%s' part %d failed. Aborting multipart upload." % (self.file.name, seq))
self.abort_upload()
- raise e
+ raise
seq += 1
debug("MultiPart: Upload finished: %d parts", seq - 1)
@@ -106,7 +106,7 @@ def abort_upload(self):
"""
debug("MultiPart: Aborting upload: %s" % self.upload_id)
request = self.s3.create_request("OBJECT_DELETE", uri = self.uri, extra = "?uploadId=%s" % (self.upload_id))
- response = self.s3.send_request(request, body = body)
+ response = self.s3.send_request(request)
return response
# vim:et:ts=4:sts=4:ai

0 comments on commit 07ed770

Please sign in to comment.