errors

package
v3.23.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 27, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package errors is a drop-in replacement for Golang lib 'errors'.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cause added in v1.1.0

func Cause(err error) error

Cause returns the root cause of this error.

func GetSeverity added in v1.1.0

func GetSeverity(err error) log.Severity

GetSeverity returns the actual severity of the error, including inner errors.

Types

type Error added in v1.1.0

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

Error is an error object with underlying error.

func New added in v1.1.0

func New(msg ...interface{}) *Error

New returns a new error object with message formed from given arguments.

func (*Error) AtDebug added in v1.1.0

func (v *Error) AtDebug() *Error

AtDebug sets the severity to debug.

func (*Error) AtError added in v1.1.0

func (v *Error) AtError() *Error

AtError sets the severity to error.

func (*Error) AtInfo added in v1.1.0

func (v *Error) AtInfo() *Error

AtInfo sets the severity to info.

func (*Error) AtWarning added in v1.1.0

func (v *Error) AtWarning() *Error

AtWarning sets the severity to warning.

func (*Error) Base added in v1.1.0

func (v *Error) Base(err error) *Error

func (*Error) Context

func (v *Error) Context() context.Context

Context returns the context that associated with the Error.

func (*Error) Error added in v1.1.0

func (v *Error) Error() string

Error implements error.Error().

func (*Error) Inner added in v1.1.0

func (v *Error) Inner() error

Inner implements hasInnerError.Inner()

func (*Error) Path

func (v *Error) Path(path ...string) *Error

Path sets the path to the location where this error happens.

func (*Error) Severity added in v1.1.0

func (v *Error) Severity() log.Severity

func (*Error) String added in v1.1.0

func (v *Error) String() string

String returns the string representation of this error.

func (*Error) WithContext

func (v *Error) WithContext(ctx context.Context) *Error

func (*Error) WriteToLog added in v1.1.0

func (v *Error) WriteToLog()

WriteToLog writes current error into log.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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