Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Output dependency installation failures to an output channel #210

Merged
merged 4 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export const CONSTANTS = {
"error.incorrectFileNameForDevicePopup",
'Seems like you have a different file name than what CPX requires, please rename it to "code.py" or "main.py".'
),
INSTALLATION_ERROR: localize(
"error.installationError",
"Installation Error"
),
INVALID_FILE_EXTENSION_DEBUG: localize(
"error.invalidFileExtensionDebug",
"The file you tried to run isn't a Python file."
Expand Down
5 changes: 5 additions & 0 deletions src/extension_utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import { DependencyChecker } from "./dependencyChecker";

const exec = util.promisify(cp.exec);

const errorChannel = vscode.window.createOutputChannel(
CONSTANTS.ERROR.INSTALLATION_ERROR
);

// tslint:disable-next-line: export-name
export const getPathToScript = (
context: vscode.ExtensionContext,
Expand Down Expand Up @@ -369,6 +373,7 @@ export const installPythonDependencies = async (
});

console.error(err);
this.logToOutputChannel(errorChannel, err.toString(), true /* show */);
installed = false;
}
return installed;
Expand Down