fault

package
v1.7.0-dev-20190926 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 0 Imported by: 138

Documentation

Overview

Package fault holds common error handling types, code and values.

Index

Constants

View Source
const InvalidErrorType = Const("Invalid type for error")

InvalidErrorType is the error returned by From when the type is not an error.

Variables

This section is empty.

Functions

func From

func From(value interface{}) error

From converts from any value to an error safely. If the value is a nil, an untyped nil is returned. If the value is not nil, but does not implement error, InvalidErrorType is returned.

Types

type Const

type Const string

Const is the type for constant error values.

func (Const) Error

func (e Const) Error() string

Error implements error for Const returning the string value of the const.

type List

type List []error

List is the type for a list of errors.

func (*List) Collect

func (l *List) Collect(err error)

Collect adds an error to the list.

func (*List) First

func (l *List) First() error

First returns the first error added to it.

type One

type One struct {
	// contains filtered or unexported fields
}

One is the type for something that collects only the first error.

func (*One) Collect

func (o *One) Collect(err error)

Collect adds an error to the list.

func (*One) First

func (o *One) First() error

First returns the first error added to it.

Directories

Path Synopsis
Package stacktrace has functionality for capturing and printing stack traces.
Package stacktrace has functionality for capturing and printing stack traces.
crunch
Package crunch provides functions to compress and decompress stacktraces.
Package crunch provides functions to compress and decompress stacktraces.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL