Skip to content

Conversation

@faust64
Copy link

@faust64 faust64 commented Jan 26, 2016

I'm still not completely sure, ... I assume this is what you looked for?

I'm still not completely sure, ... I assume this is what you looked for?
@AVVS
Copy link
Owner

AVVS commented Jan 26, 2016

just do the following and omit headers from the input
Idea is to have single exit point. Otherwise end will always fire, unless there is a networking error.
and when you have non 200 http code you will both reject and resolve

s3.deleteFile(filename, function dropFileResponse(err, response) {
   if (err) {
      return reject(err);
   }

   if (response.statusCode !== 200) {
      return reject(new Error('Failed to delete'));
   }

   response.resume();
   resolve();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants