Skip to content

Commit

Permalink
Add notification for import error
Browse files Browse the repository at this point in the history
  • Loading branch information
sudeeptarlekar committed Jul 28, 2023
1 parent cd041d4 commit 819b5b8
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ProvidersEvents } from './definitions/events';
import { history } from '@service/history';
import { bridge } from '@service/bridge';
import { HistorySession } from '@service/history/session';
import { Notification, notifications } from '@ui/service/notifications';

type TSelectedEntities = string[];

Expand Down Expand Up @@ -557,6 +558,16 @@ export class Providers {
historySession.apply(collection);
}
})
.catch(error => {
this.logger.error(error.message);
notifications.notify(
new Notification({
message: error.message,
session: this.session.uuid(),
actions: [],
})
);
})
})
},
export: (): void => {
Expand All @@ -566,7 +577,16 @@ export class Providers {
return;
history.export([historySession.collections.uuid], filename);
})
.catch(error => this.logger.error(error.message));
.catch(error => {
this.logger.error(error.message);
notifications.notify(
new Notification({
message: error.message,
session: this.session.uuid(),
actions: [],
})
);
})
}
};
}
Expand Down

0 comments on commit 819b5b8

Please sign in to comment.