apperr

package
v2.5.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseError

type BaseError struct {
	ErrorString string
}

BaseError implements Error

func (BaseError) Error

func (e BaseError) Error() string

func (BaseError) Message

func (e BaseError) Message() string

Message on the base error structure just delegates to Error()

func (BaseError) Propagate

func (e BaseError) Propagate() bool

Propagate returns true for all BaseError implementations, as they're considered somewhat unknown and therefore more likely to be severe problems

type Error

type Error interface {
	Error() string
	Message() string
	Propagate() bool // Not all errors should flag the parent as having errors
}

Error is a simple error implementation meant to be serializable so we can store errors on batches, titles, issues, and files in the same way we can return them from various operations. Our interface also provides for a Message() function which can be used for more human-friendly output for errors which are user-facing as well as functions which can be used to generally determine how to handle the error.

func Errorf

func Errorf(format string, args ...interface{}) Error

Errorf stands in for fmt.Errorf as a simpler way to generate an Error

func New

func New(err string) Error

New creates a new Error and returns it

type List

type List []Error

List simplifies places where we need multiple errors

Jump to

Keyboard shortcuts

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