errors

package
v0.0.0-...-b787089 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2016 License: MPL-2.0 Imports: 1 Imported by: 140

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.
	BadRequestError         = Code("BadRequest")
	InternalErrorError      = Code("InternalError")
	InvalidArgumentError    = Code("InvalidArgument")
	InvalidCredentialsError = Code("InvalidCredentials")
	InvalidHeaderError      = Code("InvalidHeader")
	InvalidVersionError     = Code("InvalidVersion")
	MissingParameterError   = Code("MissinParameter")
	NotAuthorizedError      = Code("NotAuthorized")
	RequestThrottledError   = Code("RequestThrottled")
	RequestTooLargeError    = Code("RequestTooLarge")
	RequestMovedError       = Code("RequestMoved")
	ResourceNotFoundError   = Code("ResourceNotFound")
	UnknownErrorError       = Code("UnknownError")
)

Variables

This section is empty.

Functions

func IsBadRequest

func IsBadRequest(err error) bool

func IsInternalError

func IsInternalError(err error) bool

func IsInvalidArgument

func IsInvalidArgument(err error) bool

func IsInvalidCredentials

func IsInvalidCredentials(err error) bool

func IsInvalidHeader

func IsInvalidHeader(err error) bool

func IsInvalidVersion

func IsInvalidVersion(err error) bool

func IsMissingParameter

func IsMissingParameter(err error) bool

func IsNotAuthorized

func IsNotAuthorized(err error) bool

func IsRequestMoved

func IsRequestMoved(err error) bool

func IsRequestThrottled

func IsRequestThrottled(err error) bool

func IsRequestTooLarge

func IsRequestTooLarge(err error) bool

func IsResourceNotFound

func IsResourceNotFound(err error) bool

func IsUnknownError

func IsUnknownError(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 NewBadRequestf

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

New creates a new BadRequest Error instance with the specified cause.

func NewInternalErrorf

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

New creates a new InternalError Error instance with the specified cause.

func NewInvalidArgumentf

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

New creates a new InvalidArgument Error instance with the specified cause.

func NewInvalidCredentialsf

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

New creates a new InvalidCredentials Error instance with the specified cause.

func NewInvalidHeaderf

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

New creates a new InvalidHeader Error instance with the specified cause.

func NewInvalidVersionf

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

New creates a new InvalidVersion Error instance with the specified cause.

func NewMissingParameterf

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

New creates a new MissingParameter Error instance with the specified cause.

func NewNotAuthorizedf

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

New creates a new NotAuthorized Error instance with the specified cause.

func NewRequestMovedf

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

New creates a new RequestMoved Error instance with the specified cause.

func NewRequestThrottledf

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

New creates a new RequestThrottled Error instance with the specified cause.

func NewRequestTooLargef

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

New creates a new RequestTooLarge Error instance with the specified cause.

func NewResourceNotFoundf

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

New creates a new ResourceNotFound Error instance with the specified cause.

func NewUnknownErrorf

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

New creates a new UnknownError Error instance with the specified cause.

func Newf

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

New creates a new UnknownError Error instance with the specified cause.

Jump to

Keyboard shortcuts

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