errors

package
v0.0.0-...-7e91c8f Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StackContext = 3
View Source
var StackLimit = 3

Functions

func Guard

func Guard(f func() error) (err error)

Capture any panic() in f() and return it as an error.

func IsFatal

func IsFatal(err error) bool

Types

type Error

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

func Annotate

func Annotate(err error, message string, args ...interface{}) *Error

Wrap err in an new Error

func New

func New(message string, args ...interface{}) *Error

Make a new Error

func NewFromPanic

func NewFromPanic(r interface{}) *Error

Make a new Error from a panic()

func (*Error) AddContext

func (e *Error) AddContext(format string, args ...interface{})

Add some context to an error

func (*Error) Error

func (e *Error) Error() string

func (*Error) SetFatal

func (e *Error) SetFatal(flag bool)

type List

type List []error

func (*List) Add

func (l *List) Add(err error)

func (List) Error

func (l List) Error() string

func (List) HasErrors

func (l List) HasErrors() bool

func (List) Normalize

func (l List) Normalize() error

type Stack

type Stack []StackFrame

func CaptureStack

func CaptureStack() Stack

func (Stack) Limit

func (s Stack) Limit(n int) Stack

func (Stack) Skip

func (s Stack) Skip(n int) Stack

func (Stack) String

func (s Stack) String() string

type StackFrame

type StackFrame struct {
	PC       uintptr
	Package  string
	Function string
	Filepath string
	Filename string
	Line     int
	InApp    bool

	HasContext  bool
	PreContext  []string
	ContextLine string
	PostContext []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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