import { i18n } from '@osd/i18n' ; import { RenderErrorHandlerFnType , ExpressionRenderError } from './types' ; import { getNotifications } from './services' ; import { IInterpreterRenderHandlers } from '../common' ; export const renderErrorHandler = ( element , error , handlers ) => { if ( error . name === 'AbortError' ) { handlers . done ( ) ; return ; } getNotifications ( ) . toasts . addError ( error , { title : i18n . translate ( 'expressions.defaultErrorRenderer.errorTitle' , { defaultMessage : 'Error in visualisation' , } ) , toastMessage : error . message , } ) ; handlers . done ( ) ; } ;