diff --git a/index.js b/index.js index 5fbe63a..598b281 100644 --- a/index.js +++ b/index.js @@ -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); }); });