errors - ActiveState ActiveGo 1.8

Package errors

import ""

Overview ▾

func Nest

func Nest(path string, err error) error

Create a NestedError with the given path. If err is a NestedError, prepend the path to it. If err is an AggregateError, recursively Nest each error.

type AggregateError

An error type for treating multiple errors as a single error.

type AggregateError []error

func (AggregateError) Error

func (err AggregateError) Error() string

Error is part of the error interface.

type NestedError

An error type for labeling errors on deeply nested matchers.

type NestedError struct {
    Path string
    Err  error

func (*NestedError) Error

func (e *NestedError) Error() string

type NestingMatcher

A stateful matcher that nests other matchers within it and preserves the error types of the nested matcher failures.

type NestingMatcher interface {

    // Returns the failures of nested matchers.
    Failures() []error