From 3fd49d8b94c604cf672fe4dae5962b075a486475 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Mon, 22 Jun 2020 21:18:36 +0300 Subject: Make bootstrap error message more informative and better-fitting --- editors/code/src/main.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 670f2ebfd..301754733 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -43,12 +43,16 @@ export async function activate(context: vscode.ExtensionContext) { const config = new Config(context); const state = new PersistentState(context.globalState); const serverPath = await bootstrap(config, state).catch(err => { - let message = "Failed to bootstrap rust-analyzer."; + let message = "bootstrap error. "; + if (err.code === "EBUSY" || err.code === "ETXTBSY") { - message += " Other vscode windows might be using rust-analyzer, " + - "you should close them and reload this window to retry."; + message += "Other vscode windows might be using rust-analyzer, "; + message += "you should close them and reload this window to retry. "; } - message += " Open \"Help > Toggle Developer Tools > Console\" to see the logs"; + + message += 'Open "Help > Toggle Developer Tools > Console" to see the logs '; + message += '(enable verbose logs with "rust-analyzer.trace.extension")'; + log.error("Bootstrap error", err); throw new Error(message); }); -- cgit v1.2.3