Skip to content

Commit 1043b77

Browse files
authored
Don't report error when deleting a local file that doesn't exist on the server (#1555)
1 parent 853332d commit 1043b77

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/utils/documentIndex.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,13 @@ function generateDeleteFn(wsFolderUri: vscode.Uri): (doc: string) => void {
121121
api.deleteDocs([...docs]).then((data) => {
122122
let failed = 0;
123123
for (const doc of data.result) {
124-
if (doc.status != "") {
125-
// The document was not deleted, so log the error
124+
if (doc.status != "" && !doc.status.includes("#16005:")) {
125+
// The document was not deleted, so log the error.
126+
// Error 16005 means we tried to delete a document
127+
// that didn't exist. Since the purpose of this
128+
// call was to delete the document, and at the
129+
// end the document isn't there, we should ignore
130+
// this error so the user doesn't get confused.
126131
failed++;
127132
outputChannel.appendLine(`${failed == 1 ? "\n" : ""}${doc.status}`);
128133
}

0 commit comments

Comments
 (0)