Documentation
¶
Index ¶
- func Collect[T any, Err error, Arg any, Func func(Arg) (T, Err)](eb *Builder, fn Func, arg Arg) T
- func IsJSONMarshallable(err error) bool
- func LogDebug(msg string, err error, logger ...*zerolog.Logger)
- func LogError(msg string, err error, logger ...*zerolog.Logger)
- func LogFatal(msg string, err error, logger ...*zerolog.Logger)
- func LogPanic(msg string, err error, logger ...*zerolog.Logger)
- func LogWarn(msg string, err error, logger ...*zerolog.Logger)
- func PrependSubject(subject string, err error) error
- type Builder
- func (b *Builder) About() string
- func (b *Builder) Add(err error)
- func (b *Builder) AddFrom(other *Builder, flatten bool)
- func (b *Builder) AddRange(errs ...error)
- func (b *Builder) Addf(format string, args ...any)
- func (b *Builder) Adds(err string)
- func (b *Builder) EnableConcurrency()
- func (b *Builder) Error() Error
- func (b *Builder) ForEach(fn func(error))
- func (b *Builder) HasError() bool
- func (b *Builder) String() string
- type Error
- type MultilineError
- func (m *MultilineError) AddLines(lines ...any) *MultilineError
- func (m *MultilineError) Addf(format string, args ...any) *MultilineError
- func (m *MultilineError) Adds(s string) *MultilineError
- func (err *MultilineError) Error() string
- func (err *MultilineError) Is(other error) bool
- func (err MultilineError) Subject(subject string) Error
- func (err *MultilineError) Subjectf(format string, args ...any) Error
- func (err *MultilineError) Unwrap() []error
- func (err MultilineError) With(extra error) Error
- func (err MultilineError) Withf(format string, args ...any) Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsJSONMarshallable ¶
func PrependSubject ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
NewBuilder creates a new Builder.
If about is not provided, the Builder will not have a subject and will expand when adding to another builder.
func NewBuilderWithConcurrency ¶ added in v0.11.0
func (*Builder) EnableConcurrency ¶ added in v0.11.0
func (b *Builder) EnableConcurrency()
type Error ¶
type Error interface { error // Is is a wrapper for errors.Is when there is no sub-error. // // When there are sub-errors, they will also be checked. Is(other error) bool // With appends a sub-error to the error. With(extra error) Error // Withf is a wrapper for With(fmt.Errorf(format, args...)). Withf(format string, args ...any) Error // Subject prepends the given subject with a colon and space to the error message. // // If there is already a subject in the error message, the subject will be // prepended to the existing subject with " > ". // // Subject empty string is ignored. Subject(subject string) Error // Subjectf is a wrapper for Subject(fmt.Sprintf(format, args...)). Subjectf(format string, args ...any) Error }
type MultilineError ¶ added in v0.11.0
type MultilineError struct {
// contains filtered or unexported fields
}
func Multiline ¶ added in v0.11.0
func Multiline() *MultilineError
func (*MultilineError) AddLines ¶ added in v0.11.0
func (m *MultilineError) AddLines(lines ...any) *MultilineError
func (*MultilineError) Addf ¶ added in v0.11.0
func (m *MultilineError) Addf(format string, args ...any) *MultilineError
func (*MultilineError) Adds ¶ added in v0.11.0
func (m *MultilineError) Adds(s string) *MultilineError
Click to show internal directories.
Click to hide internal directories.