Skip to content

Commit

Permalink
Use correct context when cleaning up
Browse files Browse the repository at this point in the history
Fixes #493
  • Loading branch information
AdityaManohar committed Feb 6, 2015
1 parent 81fbc96 commit 209f589
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/s3/managed_upload.js
Expand Up @@ -390,7 +390,9 @@ AWS.S3.ManagedUpload = AWS.util.inherit({
self.multipartReq = null;
});
self.queueChunks(chunk, partNumber);
self.multipartReq.on('error', self.cleanup);
self.multipartReq.on('error', function(err){
self.cleanup(err);
});
self.multipartReq.send();
} else {
self.queueChunks(chunk, partNumber);
Expand Down

0 comments on commit 209f589

Please sign in to comment.