Skip to content

Commit

Permalink
Properly return a bluebird promise (#8988)
Browse files Browse the repository at this point in the history
refs #8980

- ☹️ apparently this is actually the only way
  • Loading branch information
ErisDS authored and aileen committed Sep 7, 2017
1 parent f320af4 commit 45fd2d4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/server/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ module.exports = function request(url, options) {
}));
}

return got(
url,
options
).then(function (response) {
return Promise.resolve(response);
}).catch(function (err) {
return Promise.reject(err);
return new Promise(function (resolve, reject) {
return got(
url,
options
).then(function (response) {
return resolve(response);
}).catch(function (err) {
return reject(err);
});
});
};

0 comments on commit 45fd2d4

Please sign in to comment.