Properly return a bluebird promise (#8988)

refs #8980

- ☹️ apparently this is actually the only way
This commit is contained in:
Hannah Wolfe 2017-09-07 14:48:20 +01:00 committed by Aileen Nowak
parent f320af4534
commit 45fd2d437f

View File

@ -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);
});
});
};