import { i18n } from '@osd/i18n' ; import { NotificationsStart } from 'opensearch-dashboards/public' ; export const restoreUrlErrorTitle = i18n . translate ( 'opensearch_dashboards_utils.stateManagement.url.restoreUrlErrorTitle' , { defaultMessage : `Error restoring state from URL` , } ) ; export const saveStateInUrlErrorTitle = i18n . translate ( 'opensearch_dashboards_utils.stateManagement.url.saveStateInUrlErrorTitle' , { defaultMessage : `Error saving state in URL` , } ) ; /**
 * Helper for configuring  IOsdUrlStateStorage to notify about inner errors
 *
 *  example param toast export const withNotifyOnErrors = ( toasts ) => { return { onGetError : ( error ) => { toasts . addError ( error , { title : restoreUrlErrorTitle , } ) ; } , onSetError : ( error ) => { toasts . addError ( error , { title : saveStateInUrlErrorTitle , } ) ; } , } ; } ;