Documentation ¶
Overview ¶
Package merr is library for handle multiple error on golang (see https://pkg.go.dev/github.com/firdasafridi/merr?tab=overview) for more documentation
This allows a function ig Go to return an list of error. It will be useful when you do call some function to get multiple error handler.
merr is fully compatible with the Go standard library errors package, including the functions As, Is, and Unwrap. This provides a standardized approach for introspecting on error values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error struct {
Errors []error
}
Error is containt field to tract multiple errors. This accumulate errors.
func (*Error) IsError ¶
IsError returns an error if errors represent a list of errors, or return nil if the list of error is empty. This function is useful at the end of the accumulation to handling the error.
func (*Error) SetPrefix ¶
SetPrefix is function to set new error with prefix if not found it will return no error
func (*Error) Unwrap ¶
Unwrap returns an error from Error (or nil if there are no errors). This error returned will further support Unwrap to get the next error, etc. The order will match the order of Errors in the merr.Error at the time of calling.
func (*Error) WrappedErrors ¶
WrappedErrors returns the list of errors that this Error is wrapping. It is an implementation of the errwrap.Wrapper interface so that merr.Error can be used with that library.