errorsemperror.dev/errors/match Index | Files

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

func (m All) MatchError(err error) bool

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

func (m Any) MatchError(err error) bool

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.0
Published
Jan 6, 2020
Platform
linux/amd64
Imports
1 packages
Last checked
1 day ago

Tools for package owners.