Skip to content

Commit c658233

Browse files
committed
Fixed to handle error code 127 as well (command not found) #148 #178
1 parent ad77836 commit c658233

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/client/common/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ export function execPythonFile(file: string, args: string[], cwd: string, includ
110110
return execFileInternal(file, args, cwd, includeErrorAsResponse);
111111
}
112112
// return what ever error we got from the previous process
113-
Promise.reject(error);
113+
return Promise.reject(error);
114114
});
115115
}
116116

117117
function handleResponse(error: Error, stdout: string, stderr: string, file: string, includeErrorAsResponse: boolean, rejectIfENOENTErrors: boolean = false): Promise<string> {
118118
return new Promise<string>((resolve, reject) => {
119-
if (error && (<any>error).code === "ENOENT" && rejectIfENOENTErrors) {
119+
if (error && ((<any>error).code === "ENOENT") || (<any>error).code === 127) {
120120
if (!IN_VALID_FILE_PATHS.has(file)) {
121121
IN_VALID_FILE_PATHS.set(file, true);
122122
}

src/client/linters/baseLinter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export abstract class BaseLinter {
107107
});
108108

109109
resolve(diagnostics);
110-
}, error => {
110+
}).catch(error => {
111111
outputChannel.appendLine(`Linting with ${linterId} failed. If not installed please turn if off in settings.\n ${error}`);
112112
window.showInformationMessage(`Linting with ${linterId} failed. If not installed please turn if off in settings. View Python output for details.`);
113113
});

src/client/providers/lintProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export class LintProvider extends vscode.Disposable {
131131

132132
this.diagnosticCollection.delete(documentUri);
133133
this.diagnosticCollection.set(documentUri, messages);
134+
}).catch(error => {
134135
});
135136
}
136137
}

0 commit comments

Comments
 (0)