fix error description on stats for non-admin user (#5664)

pull/5669/head
Richard Wei 2021-09-20 15:41:40 +12:00 committed by GitHub
parent 49d2c68a19
commit af8065e8c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -26,7 +26,9 @@ class KubernetesNodeService {
const [details, yaml] = await Promise.all([this.KubernetesNodes().get(params).$promise, this.KubernetesNodes().getYaml(params).$promise]);
return KubernetesNodeConverter.apiToNodeDetails(details, yaml);
} catch (err) {
throw new PortainerError('Unable to retrieve node details', err);
// changing the structure of error message to fix [object, Object] issue
const errData = err.data;
throw new PortainerError('Unable to retrieve node details', errData);
}
}