import type { ListsRequestHandlerContext } from '../../types' ; import { ErrorWithStatusCode } from '../../error_with_status_code' ; import { ExceptionListClient } from '../../services/exception_lists/exception_list_client' ; export const getExceptionListClient = ( context ) : ExceptionListClient => { const exceptionLists = context . lists ?. getExceptionListClient ( ) ; if ( exceptionLists == null ) { throw new ErrorWithStatusCode ( 'Exception lists is not found as a plugin' , 404 ) ; } else { return exceptionLists ; } } ;