allow more control of filtering Reply errors #61
No reviewers
Labels
No labels
breaking-change
bug
dependencies
duplicate
enhancement
go
good first issue
help wanted
invalid
investigation
proposal
proposal-accepted
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nemith/netconf!61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nemith/error_filtering"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
Reply.Err()andRPCErrors.Filter()are useful functions to get theSevErrorlevel errors out, but some people may want to treatSevWarningas errors as well and doing it manually is a pain.As not to add a bunch of alternative functions like
RPCError.FilterWarn,Reply.ErrWarn()andReply.ErrAll()this updatesFilterandErrto take in a list of desired severity levels. If they are missing they go back to defaulting toSevErrorwhich is a sane default.Breaking change:
The API for
reply.Err()andRPCErrors.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.ErrSevErrorwas renamed toSevErrorErrSevWarningwas reanmed toSevWarningAs the API is not yet stable these changes are ok and will become stabilized after 1.0.0