Skip to content

Commit

Permalink
fix: error message when response is not 201 (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
d2lam authored Mar 12, 2019
1 parent 20eaf51 commit 72e03a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,15 @@ class ExecutorQueue extends Executor {
}

return new Promise((resolve, reject) => {
req(options, (err, response) => {
req(options, (err, response, body) => {
if (!err && response.statusCode === 201) {
return resolve(response);
}

if (body) {
return reject(body);
}

return reject(err);
});
});
Expand Down

0 comments on commit 72e03a4

Please sign in to comment.