Skip to content

core.setFailed should accept Errors #386

Description

@jasonkarns

Describe the enhancement
It's extremely common (nay, the purpose) of core.setFailed to report Errors that are caught during an action. And yet, its method signature does not accept Error instances.

It would be beneficial to accept Error instances instead of requiring users to convert to strings.

Code Snippet
This would be especially beneficial for promise chains:

somePromise().then(doThing).then(doOther).then(whatever).catch(core.setFailed)

Present behavior:

core.setFailed(Error("foo")) results in: TypeError: (s || "").replace is not a function

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions