errors

package
v1.0.0-...-3228e4f Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2017 License: LGPL-3.0 Imports: 1 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// Public available error types.
	// These errors are provided because they are specifically required by business logic in the callers.
	UnspecifiedError    = Code("Unspecified")
	NotFoundError       = Code("NotFound")
	DuplicateValueError = Code("DuplicateValue")
	TimeoutError        = Code("Timeout")
	UnauthorisedError   = Code("Unauthorised")
	NotImplementedError = Code("NotImplemented")
)

Variables

This section is empty.

Functions

func IsDuplicateValue

func IsDuplicateValue(err error) bool

func IsNotFound

func IsNotFound(err error) bool

func IsNotImplemented

func IsNotImplemented(err error) bool

func IsTimeout

func IsTimeout(err error) bool

func IsUnauthorised

func IsUnauthorised(err error) bool

Types

type Code

type Code string

type Error

type Error interface {
	error
	Cause() error
}

Error instances store an optional error cause.

func NewDuplicateValuef

func NewDuplicateValuef(cause error, context interface{}, format string, args ...interface{}) Error

NewDuplicateValuef creates a new DuplicateValue Error instance with the specified cause.

func NewNotFoundf

func NewNotFoundf(cause error, context interface{}, format string, args ...interface{}) Error

NewNotFoundf creates a new NotFound Error instance with the specified cause.

func NewNotImplementedf

func NewNotImplementedf(cause error, context interface{}, format string, args ...interface{}) Error

NewNotImplementedf creates a new NotImplemented Error instance with the specified cause.

func NewTimeoutf

func NewTimeoutf(cause error, context interface{}, format string, args ...interface{}) Error

NewTimeoutf creates a new Timeout Error instance with the specified cause.

func NewUnauthorisedf

func NewUnauthorisedf(cause error, context interface{}, format string, args ...interface{}) Error

NewUnauthorisedf creates a new Unauthorised Error instance with the specified cause.

func Newf

func Newf(cause error, format string, args ...interface{}) Error

Newf creates a new Unspecified Error instance with the specified cause.

Jump to

Keyboard shortcuts

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