Skip to content

Commit

Permalink
Refactor err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekMichali committed Oct 21, 2024
1 parent 93957c3 commit d85997b
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions testing/e2e/skr/kyma-environment-broker/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,35 +283,21 @@ class KEBClient {
};
const endpoint = `service_instances/${instanceID}/service_bindings/${bindingID}?accepts_incomplete=false`;
const config = await this.buildRequest(payload, endpoint, 'put');
return await axios.request(config);

try {
return await axios.request(config);
} catch (err) {
throw err;
}
}

async deleteBinding(instanceID, bindingID) {
const params = `service_id=${KYMA_SERVICE_ID}&plan_id=${this.planID}`;
const endpoint = `service_instances/${instanceID}/service_bindings/${bindingID}?accepts_incomplete=false&${params}`;
const config = await this.buildRequest({}, endpoint, 'delete');

try {
return await axios.request(config);
} catch (err) {
throw err;
}
return await axios.request(config);
}

async getBinding(instanceID, bindingID) {
const endpoint = `service_instances/${instanceID}/service_bindings/${bindingID}?accepts_incomplete=false`;
const config = await this.buildRequest({}, endpoint, 'get');

try {
return await axios.request(config);
} catch (err) {
throw err;
}
return await axios.request(config);
}

getPlatformRegion() {
Expand Down

0 comments on commit d85997b

Please sign in to comment.