Skip to content

Commit

Permalink
A more descriptive error message for remote HHVM (#84)
Browse files Browse the repository at this point in the history
* A more descriptive error message for remote HHVM 

Show a more descriptive error message if the connection to the remote ssh/docker HHVM server fails.

* Update src/main.ts

Co-Authored-By: Pranay Agarwal <[email protected]>
  • Loading branch information
yucombinator and PranayAgarwal committed Dec 17, 2019
1 parent 04cc387 commit 0e202e9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ export async function activate(context: vscode.ExtensionContext) {
// check if a compatible verison of hh_client is installed, or show an error message and deactivate extension typecheck & intellisense features
const version = await hh_client.version();
if (!version) {
vscode.window.showErrorMessage(
`Invalid hh_client executable: '${config.clientPath}'. Please ensure that HHVM is correctly installed or configure an alternate hh_client path in workspace settings.`
);
return;
let errMsg = `Invalid hh_client executable: '${config.clientPath}'. Please ensure that HHVM is correctly installed or configure an alternate hh_client path in workspace settings.`;

if (config.remoteEnabled && config.remoteType === 'ssh') {
errMsg = `Unable to connect to remote Hack server, please ensure it is running, and restart VSCode.`;
} else if (config.remoteEnabled && config.remoteType === 'docker') {
errMsg = `Unable to connect to the HHVM Docker container, please ensure the container and HHVM is running, and restart VSCode.`;
}

vscode.window.showErrorMessage(errMsg);
}

const services: Promise<void>[] = [];
Expand Down

0 comments on commit 0e202e9

Please sign in to comment.