Skip to content

Commit

Permalink
Suppress NotFound error when deleting saved objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
skh committed Mar 11, 2021
1 parent 8695edb commit e89e9b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x-pack/plugins/fleet/server/services/epm/packages/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export async function removeInstallation(options: {
return installedAssets;
}

// TODO we have both deleteKibanaAssets and deleteKibanaSavedObjectsAssets (below)
function deleteKibanaAssets(
installedObjects: KibanaAssetReference[],
savedObjectsClient: SavedObjectsClientContract
Expand Down Expand Up @@ -135,6 +136,7 @@ async function deleteTemplate(esClient: ElasticsearchClient, name: string): Prom
}
}

// TODO we have both deleteKibanaSavedObjectsAssets and deleteKibanaAssets (above)
export async function deleteKibanaSavedObjectsAssets(
savedObjectsClient: SavedObjectsClientContract,
installedRefs: AssetReference[]
Expand All @@ -152,6 +154,8 @@ export async function deleteKibanaSavedObjectsAssets(
try {
await Promise.all(deletePromises);
} catch (err) {
logger.warn(err);
if (!savedObjectsClient.errors.isNotFoundError(err)) {
logger.error(err);
}
}
}

0 comments on commit e89e9b0

Please sign in to comment.