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

Fix GitHub workflow and revert Errorf behavior for 1 wrapped error #8

Merged
merged 8 commits into from
May 15, 2024

Conversation

phughes-scwx
Copy link
Contributor

@phughes-scwx phughes-scwx commented May 15, 2024

errors.Errof slight reversion

Complicates a bit (for the better) how the new errors.Errorf works:

  • for 0 or 1 wrapped errors, we use errors.WithFrame around the returned error, so that printing with %+v will trigger viewing the frames;
  • for >1 error we use errors.WithFrame on the wrapped errors.

Will make migrating from v0.1 to v0.2 not break this expectation, and is nice.

Also use errors.Errorsf in examples instead of fmt.Errorf and update some tests accordingly.

Clarify and add back in tests for errors.ErrorsFrom

Uncomment the tests, add docs, and update tests to work with the new, kind of nerfed, errors.ErrorsFrom.

Fix the workflow

Throw out the included boilerplate in favor of a working YAML file. Also:

  • fix lint issues;
  • fix tests assertions that failed on CI due to issues in how Ubuntu prints a stack frame name.

@phughes-scwx phughes-scwx merged commit 2bb710e into main May 15, 2024
2 checks passed
@phughes-scwx phughes-scwx deleted the phughes-fix-action branch May 15, 2024 20:00
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.

2 participants