diff --git a/ui/src/app/metadata/editor/MetadataEditor.js b/ui/src/app/metadata/editor/MetadataEditor.js index fac1c1fa7..2adc5b273 100644 --- a/ui/src/app/metadata/editor/MetadataEditor.js +++ b/ui/src/app/metadata/editor/MetadataEditor.js @@ -51,8 +51,8 @@ export function MetadataEditor ({ restore, current, reload }) { .then(() => { gotoDetail({ refresh: true }); }) - .catch((err) => { - notificationDispatch(createNotificationAction(`Updated data with latest changes`, NotificationTypes.INFO)) + .catch((err, notification) => { + notificationDispatch(notification || createNotificationAction(`${err.errorCode} - ${translator(err.errorMessage)}`, NotificationTypes.ERROR)); }); }; diff --git a/ui/src/app/metadata/hooks/api.js b/ui/src/app/metadata/hooks/api.js index 9c2d2f90c..d5add90a1 100644 --- a/ui/src/app/metadata/hooks/api.js +++ b/ui/src/app/metadata/hooks/api.js @@ -1,6 +1,7 @@ import useFetch from 'use-http'; import API_BASE_PATH from '../../App.constant'; +import { createNotificationAction, NotificationTypes } from '../../notifications/hoc/Notifications'; import { useContentionDispatcher, openContentionModalAction } from '../contention/ContentionContext'; import {MetadataFilterTypes} from '../domain/filter'; @@ -113,7 +114,7 @@ export function useMetadataUpdater (path, current, cancel) { resolve(await update(p, resolution)); }, (err) => { cancel && cancel(); - reject(err); + reject(err, createNotificationAction(`Updated data with latest changes`, NotificationTypes.INFO)); })); }); }