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 F0B401FF13A for ; Wed, 29 Apr 2026 11:58:03 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D11D8277CE; Wed, 29 Apr 2026 11:58:03 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 29 Apr 2026 11:57:29 +0200 Message-Id: From: "Daniel Kral" To: "Arthur Bied-Charreton" , Subject: Re: [PATCH proxmox-backup] EncryptionKeysView: Fix API2 error alert messages X-Mailer: aerc 0.21.0-136-gdb9fe9896a79-dirty References: <20260428150950.50795-1-a.bied-charreton@proxmox.com> In-Reply-To: <20260428150950.50795-1-a.bied-charreton@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777456552050 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.078 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 Message-ID-Hash: DD3E57LBZLYWIN3SUHTIXDEQ36UCBBC4 X-Message-ID-Hash: DD3E57LBZLYWIN3SUHTIXDEQ36UCBBC4 X-MailFrom: d.kral@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 5:09 PM CEST, 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/EncryptionKeys= View.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')); > } > =20 > 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')); > } > =20 > let store =3D view.getStore().rstore; Usually we use `error.htmlStatus` for the error message, but this should be fine here as well. This fixes the issue for me as well, so consider as: Reviewed-by: Daniel Kral Tested-by: Daniel Kral