Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support AggregateError #69

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

whilefoo
Copy link
Member

loggerError = context.logger.error(`Error: ${error}`, { error: error });
} else if (error instanceof LogReturn) {
core.setFailed(error.logMessage.raw);
let loggerError: LogReturn | Error;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be worth to wrap this in a function? It seems that it is the same logic for actions and workers, would avoid duplicate code and mistakes

@gentlementlegen
Copy link
Member

The problem with aggregate error is that it accepts pretty much anything, so if you push an array of logger errors then it looks like this:

Meniole/plugin-template#1 (comment)

Corresponding code:

  throw new AggregateError([new Error("error 1"), new Error("error 2"), logger.error("logger error"), new RangeError("range error")]);

But I think it would be the logger responsibility to properly handle toString() method so it doesn't display this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle error arrays like AggregateError for proper display
2 participants