1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Catch errors return error response when fetching chart or chart values fails (#1478)

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2020-11-23 13:45:07 +02:00 committed by GitHub
parent 2f17a7ec67
commit 19150fca84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,14 +12,22 @@ class HelmApiRoute extends LensApi {
public async getChart(request: LensApiRequest) {
const { params, query, response } = request;
try {
const chart = await helmService.getChart(params.repo, params.chart, query.get("version"));
this.respondJson(response, chart);
} catch (error) {
this.respondText(response, error, 422);
}
}
public async getChartValues(request: LensApiRequest) {
const { params, query, response } = request;
try {
const values = await helmService.getChartValues(params.repo, params.chart, query.get("version"));
this.respondJson(response, values);
} catch (error) {
this.respondText(response, error, 422);
}
}
public async installChart(request: LensApiRequest) {