import { SavedObjectsErrorHelpers } from '../../../../../src/core/server' ; import { TaskStore } from '../task_store' ; param taskStore param taskId export async function removeIfExists ( taskStore , taskId ) { try { await taskStore . remove ( taskId ) ; } catch ( err ) { if ( ! SavedObjectsErrorHelpers . isNotFoundError ( err ) ) { throw err ; } } }