From 1b72acbf2fd2cd0f5bc67a49192fa88e7d067bab Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sun, 7 Nov 2021 21:01:30 +0100 Subject: [PATCH] ui: join info: rework error handling/checking for no-cluster check if error is set before trying to access it and check for the new HTTP code a newer pve-cluster may return, and do a more fuzzy match for older ones. Signed-off-by: Thomas Lamprecht --- www/manager6/dc/Cluster.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/www/manager6/dc/Cluster.js b/www/manager6/dc/Cluster.js index 865bf6bc..3e83268a 100644 --- a/www/manager6/dc/Cluster.js +++ b/www/manager6/dc/Cluster.js @@ -68,10 +68,12 @@ Ext.define('PVE.ClusterAdministration', { let data = records?.[0]?.data; if (!success || !data || !data.nodelist?.length) { let error = operation.getError(); - let msg = Proxmox.Utils.getResponseErrorMessage(error); - if (msg !== 'node is not in a cluster, no join info available! (500)') { - // show the real message - Proxmox.Utils.setErrorMask(this.getView(), msg); + if (error) { + let msg = Proxmox.Utils.getResponseErrorMessage(error); + if (error.status !== 424 && !msg.match(/node is not in a cluster/i)) { + // an actual error, not just the "not in a cluster one", so show it! + Proxmox.Utils.setErrorMask(this.getView(), error); + } } vm.set('totem', {}); vm.set('isInCluster', false);