From fba775c89d0dc1fa6ea892d168412152a24727f5 Mon Sep 17 00:00:00 2001 From: Oleh Paduchak Date: Mon, 16 Dec 2024 14:10:54 +0200 Subject: [PATCH] added response detail to configuration error toast --- .../components/addons-service/manager/component.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/osf-components/addon/components/addons-service/manager/component.ts b/lib/osf-components/addon/components/addons-service/manager/component.ts index 2d8ee89bc1..d0ca89f031 100644 --- a/lib/osf-components/addon/components/addons-service/manager/component.ts +++ b/lib/osf-components/addon/components/addons-service/manager/component.ts @@ -259,9 +259,16 @@ export default class AddonsServiceManagerComponent extends Component { } this.cancelSetup(); } catch(e) { - this.toast.error(this.intl.t('addons.configure.error', { + const baseMessage = this.intl.t('addons.configure.error', { configurationName: this.selectedConfiguration?.displayName, - })); + }); + if (e.errors && e.errors[0].detail) { + const apiMessage = e.errors[0].detail; + this.toast.error(`${baseMessage}: ${apiMessage}`); + } else { + this.toast.error(baseMessage); + } + } }