From af8065e8c24398c688f04dc7f7c9e06a34cc8046 Mon Sep 17 00:00:00 2001 From: Richard Wei <54336863+WaysonWei@users.noreply.github.com> Date: Mon, 20 Sep 2021 15:41:40 +1200 Subject: [PATCH] fix error description on stats for non-admin user (#5664) --- app/kubernetes/node/service.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/kubernetes/node/service.js b/app/kubernetes/node/service.js index e2d207f7b..80c0ec267 100644 --- a/app/kubernetes/node/service.js +++ b/app/kubernetes/node/service.js @@ -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); } }