import { AccessForbidden , IndexNotFound , CannotCreateIndex , ReindexTaskCannotBeDeleted , ReindexTaskFailed , ReindexAlreadyInProgress , MultipleReindexJobsFound , ReindexCannotBeCancelled , ReindexIsNotInQueue , } from './error_symbols' ; export class ReindexError extends Error { constructor ( message , public readonly symbol ) { super ( message ) ; } } export const createErrorFactory = ( symbol ) => ( message ) => { return new ReindexError ( message , symbol ) ; } ; export const error = { indexNotFound : createErrorFactory ( IndexNotFound ) , accessForbidden : createErrorFactory ( AccessForbidden ) , cannotCreateIndex : createErrorFactory ( CannotCreateIndex ) , reindexTaskFailed : createErrorFactory ( ReindexTaskFailed ) , reindexTaskCannotBeDeleted : createErrorFactory ( ReindexTaskCannotBeDeleted ) , reindexAlreadyInProgress : createErrorFactory ( ReindexAlreadyInProgress ) , reindexIsNotInQueue : createErrorFactory ( ReindexIsNotInQueue ) , multipleReindexJobsFound : createErrorFactory ( MultipleReindexJobsFound ) , reindexCannotBeCancelled : createErrorFactory ( ReindexCannotBeCancelled ) , } ;