fix error description on stats for non-admin users (#5665)

pull/5668/head
Richard Wei 2021-09-20 15:41:46 +12:00 committed by GitHub
parent dc769b4c4d
commit 7c9f7a2a8b
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);
}
}