From 45c24094535a9855a4a44c8fe87b658b49cfee6d Mon Sep 17 00:00:00 2001 From: Dusan Trickovic Date: Tue, 19 Sep 2023 12:36:22 +0200 Subject: [PATCH] Change output message --- packages/helpers/__tests__/exec-command-wrapper.test.ts | 2 +- packages/helpers/src/exec-command-wrapper.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/helpers/__tests__/exec-command-wrapper.test.ts b/packages/helpers/__tests__/exec-command-wrapper.test.ts index 04401a3f..ffbf208d 100644 --- a/packages/helpers/__tests__/exec-command-wrapper.test.ts +++ b/packages/helpers/__tests__/exec-command-wrapper.test.ts @@ -77,7 +77,7 @@ describe('Command', () => { const result = await command.execute() expect(result.stdout).toBe('') } catch (err) { - expect(err.message).toContain('Command produced empty output.') + expect(err.message).toContain('The command produced an empty output.') } }) }) diff --git a/packages/helpers/src/exec-command-wrapper.ts b/packages/helpers/src/exec-command-wrapper.ts index 317bf596..b0dd3ccf 100644 --- a/packages/helpers/src/exec-command-wrapper.ts +++ b/packages/helpers/src/exec-command-wrapper.ts @@ -35,7 +35,7 @@ export default class CommandHelper { } if (this.config.throwOnEmptyOutput && output.stdout.trim() === '') { - this.onError('Command produced empty output.').throw() + this.onError(`The command produced an empty output.`).throw() } if (this.config.failOnError && output.stderr) { @@ -43,7 +43,7 @@ export default class CommandHelper { } if (this.config.failOnEmptyOutput && output.stdout.trim() === '') { - this.onError('Command produced empty output.').fail() + this.onError(`The command produced an empty output.`).fail() } return output @@ -56,8 +56,6 @@ export default class CommandHelper { throw: () => never fail: () => void } { - core.error(`Error occurred: ${errorMessage}`) - return { throw: () => { throw new Error(errorMessage)