From 0c8652569e642b2df57cce897653523a45406c1c Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Thu, 26 Jan 2023 10:35:10 +0100 Subject: [PATCH] Fix error message --- dist/index.js | 4 ++-- src/installer.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 51c191c..4bc0ba8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -398,9 +398,9 @@ class DotnetCoreInstaller { ignoreReturnCode: true, env: process.env }; - const { exitCode, stdout } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, getExecOutputOptions); + const { exitCode, stderr } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, getExecOutputOptions); if (exitCode) { - throw new Error(`Failed to install dotnet ${exitCode}. ${stdout}`); + throw new Error(`Failed to install dotnet, exit code: ${exitCode}. ${stderr}`); } return this.outputDotnetVersion(dotnetVersion.value); }); diff --git a/src/installer.ts b/src/installer.ts index 25b71aa..c25af51 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -236,13 +236,15 @@ export class DotnetCoreInstaller { ignoreReturnCode: true, env: process.env as {string: string} }; - const {exitCode, stdout} = await exec.getExecOutput( + const {exitCode, stderr} = await exec.getExecOutput( `"${scriptPath}"`, scriptArguments, getExecOutputOptions ); if (exitCode) { - throw new Error(`Failed to install dotnet ${exitCode}. ${stdout}`); + throw new Error( + `Failed to install dotnet, exit code: ${exitCode}. ${stderr}` + ); } return this.outputDotnetVersion(dotnetVersion.value);