Give better error message when the rust-analyzer binar path was set in the user's config but the binary is invalid

This commit is contained in:
Ryan Levick 2021-08-03 14:03:49 +02:00
parent da894358e1
commit ac50e35325

View File

@ -252,7 +252,12 @@ async function bootstrapServer(config: Config, state: PersistentState): Promise<
log.info("Using server binary at", path);
if (!isValidExecutable(path)) {
throw new Error(`Failed to execute ${path} --version`);
if (config.serverPath) {
throw new Error(`Failed to execute ${path} --version. \`config.server.path\` or \`config.serverPath\` has been set explicitly.\
Consider removing this config or making a valid server binary available at that path.`);
} else {
throw new Error(`Failed to execute ${path} --version`);
}
}
return path;