package match
import "emperror.dev/errors/match"
Index ¶
Types ¶
type All ¶
type All []ErrorMatcher
All matches an error if all of the underlying matchers match it.
func (All) MatchError ¶
MatchError calls underlying matchers with err. If all of them matches err it returns true, otherwise false.
type Any ¶
type Any []ErrorMatcher
Any matches an error if any of the underlying matchers match it.
func (Any) MatchError ¶
MatchError calls underlying matchers with err. If any of them matches err it returns true, otherwise false.
type ErrorMatcher ¶
type ErrorMatcher interface { // MatchError checks if err matches a certain condition. MatchError(err error) bool }
ErrorMatcher checks if an error matches a certain condition.
func As ¶
func As(target interface{}) ErrorMatcher
As returns an error matcher that determines matching by calling errors.As.
func Is ¶
func Is(target error) ErrorMatcher
Is returns an error matcher that determines matching by calling errors.Is.
Source Files ¶
match.go
- Version
- v0.5.1
- Published
- Jan 6, 2020
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 1 day ago –
Tools for package owners.