mirror of https://github.com/actions/toolkit
Change output message
parent
31cd25530e
commit
45c2409453
|
@ -77,7 +77,7 @@ describe('Command', () => {
|
||||||
const result = await command.execute()
|
const result = await command.execute()
|
||||||
expect(result.stdout).toBe('')
|
expect(result.stdout).toBe('')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
expect(err.message).toContain('Command produced empty output.')
|
expect(err.message).toContain('The command produced an empty output.')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -35,7 +35,7 @@ export default class CommandHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.config.throwOnEmptyOutput && output.stdout.trim() === '') {
|
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) {
|
if (this.config.failOnError && output.stderr) {
|
||||||
|
@ -43,7 +43,7 @@ export default class CommandHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.config.failOnEmptyOutput && output.stdout.trim() === '') {
|
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
|
return output
|
||||||
|
@ -56,8 +56,6 @@ export default class CommandHelper {
|
||||||
throw: () => never
|
throw: () => never
|
||||||
fail: () => void
|
fail: () => void
|
||||||
} {
|
} {
|
||||||
core.error(`Error occurred: ${errorMessage}`)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
throw: () => {
|
throw: () => {
|
||||||
throw new Error(errorMessage)
|
throw new Error(errorMessage)
|
||||||
|
|
Loading…
Reference in New Issue