Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #38 from errata-ai/errors
Browse files Browse the repository at this point in the history
Redirect errors to our own console
  • Loading branch information
ChrisChinchilla authored Dec 10, 2020
2 parents 0a04749 + a6b094c commit 7cbd30b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/features/vsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ export default class ValeServerProvider implements vscode.CodeActionProvider {
} else if (configLocation !== "") {
stylesPath = [
binaryLocation,
"--no-exit",
"--output=JSON",
"--config",
configLocation,
"ls-config",
];
} else {
stylesPath = [binaryLocation, "--no-exit", "ls-config"];
stylesPath = [binaryLocation, "--output=JSON", "ls-config"];
}

const configOut = await utils.runInWorkspace(folder, stylesPath);
Expand All @@ -103,7 +103,7 @@ export default class ValeServerProvider implements vscode.CodeActionProvider {
const stdout = await utils.runInWorkspace(folder, command);
this.handleJSON(stdout.toString(), file, 0);
} catch (error) {
vscode.window.showErrorMessage(`[Vale]: ${error}`);
this.logger.appendLine(error);
}
}

Expand All @@ -114,7 +114,6 @@ export default class ValeServerProvider implements vscode.CodeActionProvider {
) {
const diagnostics: vscode.Diagnostic[] = [];
const backend = this.useCLI ? "Vale" : "Vale Server";

let body = JSON.parse(contents.toString());
if (body.Code && body.Text) {
this.logger.appendLine(body.Text);
Expand Down

0 comments on commit 7cbd30b

Please sign in to comment.