import type { Payload } from '@hapi/boom' ; import Boom from '@hapi/boom' ; import type { SavedObjectsImportError } from 'src/core/server' ; export const createEmptyFailureResponse = ( errors ? ) => { const errorMessages = ( errors || [ ] ) . map ( ( error ) => { if ( Boom . isBoom ( error as any ) ) { return ( error as Boom . Boom ) . output . payload as Payload ; } return error as SavedObjectsImportError ; } ) ; return { success : false , successCount : 0 , errors : errorMessages , } ; } ;