Skip to content

Commit

Permalink
correctly display error on view creation
Browse files Browse the repository at this point in the history
  • Loading branch information
datomo committed Apr 7, 2024
1 parent 2a25316 commit b3c10f0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/app/components/data-view/view/view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b3c10f0

Please sign in to comment.