From 514e0bf4cbc72d706729f06acccbb110788967bf Mon Sep 17 00:00:00 2001 From: Brett Saviano Date: Fri, 16 May 2025 14:10:09 -0400 Subject: [PATCH] Don't report error when deleting a local file that doesn't exist on the server --- src/utils/documentIndex.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/documentIndex.ts b/src/utils/documentIndex.ts index d7b15955..370813e4 100644 --- a/src/utils/documentIndex.ts +++ b/src/utils/documentIndex.ts @@ -121,8 +121,13 @@ function generateDeleteFn(wsFolderUri: vscode.Uri): (doc: string) => void { api.deleteDocs([...docs]).then((data) => { let failed = 0; for (const doc of data.result) { - if (doc.status != "") { - // The document was not deleted, so log the error + if (doc.status != "" && !doc.status.includes("#16005:")) { + // The document was not deleted, so log the error. + // Error 16005 means we tried to delete a document + // that didn't exist. Since the purpose of this + // call was to delete the document, and at the + // end the document isn't there, we should ignore + // this error so the user doesn't get confused. failed++; outputChannel.appendLine(`${failed == 1 ? "\n" : ""}${doc.status}`); }