Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dropFile #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

dropFile #5

wants to merge 1 commit into from

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