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

allow more control of filtering Reply errors #61

Merged
merged 1 commit into from
Aug 29, 2023
Merged

Conversation

nemith
Copy link
Owner

@nemith nemith commented Aug 29, 2023

The Reply.Err() and RPCErrors.Filter() are useful functions to get the SevError level errors out, but some people may want to treat SevWarning as errors as well and doing it manually is a pain.

As not to add a bunch of alternative functions like RPCError.FilterWarn, Reply.ErrWarn() and Reply.ErrAll() this updates Filter and Err to take in a list of desired severity levels. If they are missing they go back to defaulting to SevError which is a sane default.

Breaking change:

The API for reply.Err() and RPCErrors.Filter() were changed as above. For most call sites this should be fine but anyone using this function in a interface or explicitly using it as a type will break.
ErrSevError was renamed to SevError
ErrSevWarning was reanmed to SevWarning

As the API is not yet stable these changes are ok and will become stabilized after 1.0.0

@nemith nemith added the breaking-change For PRs that bust the API. To be used for cutting releases label Aug 29, 2023
@nemith nemith force-pushed the nemith/error_filtering branch from 2970880 to d37c21c Compare August 29, 2023 18:22
@nemith nemith merged commit becda36 into main Aug 29, 2023
@nemith nemith deleted the nemith/error_filtering branch August 29, 2023 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change For PRs that bust the API. To be used for cutting releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant