Skip to content

Commit 24ec41b

Browse files
authored
Merge pull request #51 from envoy/fix-plugin-install-config-catch
SQ-4167: fix promise handling on plugin install config call
2 parents dea5dd5 + 0aa1d94 commit 24ec41b

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

lib/EnvoyAPI.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,14 @@ class EnvoyAPI {
387387
* @returns {Promise<{}>}
388388
*/
389389
async getPluginInstallConfig(installId) {
390-
return new Promise((resolve, reject) => {
391-
this.request({
392-
method: 'GET',
393-
url: `/api/v2/plugin-services/installs/${installId}/config`,
394-
}).then(body => resolve(EnvoyAPI.getDataFromBody(body)))
395-
.catch((error) => {
396-
EnvoyAPI.safeRequestsError(error).catch((err) => reject(err));
397-
});
390+
const body = await this.request({
391+
method: 'GET',
392+
url: `/api/v2/plugin-services/installs/${installId}/config`,
393+
}).catch((error) => {
394+
return EnvoyAPI.safeRequestsError(error);
398395
});
396+
397+
return EnvoyAPI.getDataFromBody(body);
399398
}
400399

401400
/**

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@envoy/envoy-integrations-sdk",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)