From b3c10f09318147447950df1b369934cbe6ed5ea5 Mon Sep 17 00:00:00 2001 From: datomo Date: Mon, 8 Apr 2024 00:12:55 +0200 Subject: [PATCH] correctly display error on view creation --- src/app/components/data-view/view/view.component.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/components/data-view/view/view.component.ts b/src/app/components/data-view/view/view.component.ts index 0781af00..61db4737 100644 --- a/src/app/components/data-view/view/view.component.ts +++ b/src/app/components/data-view/view/view.component.ts @@ -106,9 +106,16 @@ export class ViewComponent { if (doExecute) { this.executeQuery(fullQuery) - .then(() => { - this.$showView.set(false); - this._toast.success((this.$type() === ViewType.MATERIALIZED ? 'Materialized View "' : 'View "') + this.$viewName() + '" has been created successfully.', "Successfully Created View"); + .then(res => { + if (res && res[0] && res[0].hasOwnProperty('error')) { + this._toast.error(res[0]['error']) + this.$showView.set(false); + } else { + this.$showView.set(false); + this._toast.success((this.$type() === ViewType.MATERIALIZED ? 'Materialized View "' : 'View "') + this.$viewName() + '" has been created successfully.', "Successfully Created View"); + } + + }).catch(reason => { this._toast.error(reason) this.$showView.set(false);