sgerrors

package
v2.0.0-beta.3+incompat... Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: Apache-2.0 Imports: 1 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCredentials  = New("invalid credentials", InvalidCredentials)
	ErrNotFound            = New("entity not found", NotFound)
	ErrAlreadyExists       = New("entity already exists", EntityAlreadyExists)
	ErrUnknownProvider     = New("unknown provider type", UnknownProvider)
	ErrUnsupportedProvider = New("unsupported provider", UnsupportedProvider)
	ErrInvalidJson         = New("invalid json", InvalidJSON)
	ErrNilValue            = New("nil value", NilValue)
	ErrTokenExpired        = New("token has been expire", TokenExpired)
	ErrNilEntity           = New("nil entity", NilEntity)
	ErrTimeoutExceeded     = New("timeout exceeded", TimeoutExceeded)
)

Functions

func IsAlreadyExists

func IsAlreadyExists(err error) bool

func IsInvalidCredentials

func IsInvalidCredentials(err error) bool

func IsNotFound

func IsNotFound(err error) bool

func IsTimeoutExceeded

func IsTimeoutExceeded(err error) bool

func IsUnknownProvider

func IsUnknownProvider(err error) bool

func IsUnsupportedProvider

func IsUnsupportedProvider(err error) bool

func New

func New(msg string, code ErrorCode) error

Types

type Error

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

func (*Error) Error

func (e *Error) Error() string

type ErrorCode

type ErrorCode int
const (
	UnknownError        ErrorCode = 1000
	ValidationFailed    ErrorCode = 1001
	InvalidCredentials  ErrorCode = 1003
	NotFound            ErrorCode = 1004
	InvalidJSON         ErrorCode = 1005
	CantChangeID        ErrorCode = 1006
	EntityAlreadyExists ErrorCode = 1007
	UnknownProvider     ErrorCode = 1008
	UnsupportedProvider ErrorCode = 1009
	NilValue            ErrorCode = 1010
	TokenExpired        ErrorCode = 1011
	AlreadyExists       ErrorCode = 1010
	NilEntity           ErrorCode = 1011
	TimeoutExceeded     ErrorCode = 1012
)

Jump to

Keyboard shortcuts

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