From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 8315E1FF13A for ; Wed, 29 Apr 2026 12:06:05 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5EA9E27FB4; Wed, 29 Apr 2026 12:06:05 +0200 (CEST) Date: Wed, 29 Apr 2026 12:05:30 +0200 From: Arthur Bied-Charreton To: pbs-devel@lists.proxmox.com Subject: Re: [PATCH proxmox-backup] EncryptionKeysView: Fix API2 error alert messages Message-ID: References: <20260428150950.50795-1-a.bied-charreton@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260428150950.50795-1-a.bied-charreton@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777457033800 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.770 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Message-ID-Hash: STX6TVD4OVLOJWG63SYUL64OZVF7VR7D X-Message-ID-Hash: STX6TVD4OVLOJWG63SYUL64OZVF7VR7D X-MailFrom: a.bied-charreton@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, Apr 28, 2026 at 05:09:50PM +0200, Arthur Bied-Charreton wrote: > The errors returned by the encryption-keys and tape-encryption-keys > endpoints are not plain strings, so the alerts displayed on API2 errors > like failed permission checks end up being empty and therefore not very > helpful. > > Extract the error messages to display them correctly in alerts. > > Signed-off-by: Arthur Bied-Charreton > --- > www/config/EncryptionKeysView.js | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/www/config/EncryptionKeysView.js b/www/config/EncryptionKeysView.js > index 0f9367c7..bb327814 100644 > --- a/www/config/EncryptionKeysView.js > +++ b/www/config/EncryptionKeysView.js > @@ -168,7 +168,7 @@ Ext.define('PBS.config.EncryptionKeysView', { > }); > } > } catch (error) { > - Ext.Msg.alert(gettext('Error'), error); > + Ext.Msg.alert(gettext('Error'), error.result?.message || gettext('Unknown error')); > } > > try { > @@ -181,7 +181,7 @@ Ext.define('PBS.config.EncryptionKeysView', { > }); > } > } catch (error) { > - Ext.Msg.alert(gettext('Error'), error); > + Ext.Msg.alert(gettext('Error'), error.result?.message || gettext('Unknown error')); > } > > let store = view.getStore().rstore; > -- > 2.47.3 > > > > Thanks @Daniel, @Thomas and @Christian for the feedback! Sent v2: https://lore.proxmox.com/pbs-devel/20260429100257.155092-1-a.bied-charreton@proxmox.com