Skip to content

Commit

Permalink
bugfix: Ignore error caused by request cancelled (#1083)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored Oct 19, 2020
1 parent 66b9e16 commit f27f9e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utils/commandUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,15 @@ async function executeJavaLanguageServerCommand<T>(...rest: any[]): Promise<T |
try {
return await commands.executeCommand<T>(JavaLanguageServerCommands.EXECUTE_WORKSPACE_COMMAND, ...rest);
} catch (error) {
if (isCancelledError(error)) {
return;
}
logger.error(error.toString());
throw error;
}
}

function isCancelledError(error: any): boolean {
// See: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#responseMessage
return error.code === -32800;
}

0 comments on commit f27f9e0

Please sign in to comment.