diff --git a/src/app/Notifications/Notifications.tsx b/src/app/Notifications/Notifications.tsx index d318c7311..962da2459 100644 --- a/src/app/Notifications/Notifications.tsx +++ b/src/app/Notifications/Notifications.tsx @@ -46,7 +46,7 @@ export interface Notification { read?: boolean; key?: string; title: string; - message?: string; + message?: string | Error; category?: string; variant: AlertVariant; timestamp?: number; @@ -63,6 +63,11 @@ export class Notifications { } notification.read = false; notification.timestamp = +Date.now(); + if (notification.message instanceof Error) { + notification.message = JSON.stringify(notification.message, Object.getOwnPropertyNames(notification.message)); + } else if (typeof notification.message !== 'string') { + notification.message = JSON.stringify(notification.message); + } this._notifications.unshift(notification); this._notifications$.next(this._notifications); }