import { SavedObject } from '../../../types' ; public export class SavedObjectsImportError extends Error { private constructor ( public readonly type , message , public readonly attributes ? ) { super ( message ) ; Object . setPrototypeOf ( this , SavedObjectsImportError . prototype ) ; } static importSizeExceeded ( limit ) { return new SavedObjectsImportError ( 'import-size-exceeded' , `Can't import more than ${ limit } objects` ) ; } static nonUniqueImportObjects ( nonUniqueEntries ) { return new SavedObjectsImportError ( 'non-unique-entries' , `Non-unique import objects detected: [${ nonUniqueEntries . join ( ) }]` ) ; } static nonUniqueRetryObjects ( nonUniqueRetryObjects ) { return new SavedObjectsImportError ( 'non-unique-retry-objects' , `Non-unique retry objects: [${ nonUniqueRetryObjects . join ( ) }]` ) ; } static nonUniqueRetryDestinations ( nonUniqueRetryDestinations ) { return new SavedObjectsImportError ( 'non-unique-retry-destination' , `Non-unique retry destinations: [${ nonUniqueRetryDestinations . join ( ) }]` ) ; } static referencesFetchError ( objects ) { return new SavedObjectsImportError ( 'references-fetch-error' , 'Error fetching references for imported objects' , { objects , } ) ; } }