errors

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the error is an Upbound SDK NotFound error, and false otherwise.

Types

type Error

type Error struct {
	Err     error
	Type    ErrorType
	Message string
}

Error is an Upbound SDK error.

func New

func New(err error, msg string, errType ErrorType) *Error

New constructs a new Upbound SDK error.

func (*Error) Error

func (e *Error) Error() string

Error returns the error message with the underlying error.

func (*Error) IsNotFound

func (e *Error) IsNotFound() bool

IsNotFound returns true if the error type is ErrorTypeNotFound, and false otherwise.

type ErrorType

type ErrorType string

ErrorType indicates the type of error.

const (
	ErrorTypeForbidden    ErrorType = "Forbidden"
	ErrorTypeNotFound     ErrorType = "NotFound"
	ErrorTypeUnauthorized ErrorType = "Unauthorized"
	ErrorTypeUnknown      ErrorType = "Unknown"
)

Upbound SDK error types.

Jump to

Keyboard shortcuts

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