From b3d2c60d272757d2547c210b01a65b7603bfabd0 Mon Sep 17 00:00:00 2001 From: Nancy Butler <42977925+mantis-toboggan-md@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:12:57 -0700 Subject: [PATCH] fix azure error message formatting --- .../cluster-driver/driver-import-aks/component.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/shared/addon/components/cluster-driver/driver-import-aks/component.js b/lib/shared/addon/components/cluster-driver/driver-import-aks/component.js index 2a6ce1a603..c0381f7b6f 100644 --- a/lib/shared/addon/components/cluster-driver/driver-import-aks/component.js +++ b/lib/shared/addon/components/cluster-driver/driver-import-aks/component.js @@ -124,7 +124,14 @@ export default Component.extend(ClusterDriver, { cb(true); } } catch (err) { - errors.pushObject(`Failed to load Clusters from Azure: ${ err.message }`); + let msg = '' + + if (err.message){ + msg = err.message + } else if (err?.body?.error){ + msg = err.body.error + } + errors.pushObject(`Failed to load Clusters from Azure: ${ msg }`); // Azure List Clusters API fails sometimes to list this, user cnn input a cluster name though so dont fail setProperties(this, {