sgerrors

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 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)
)

Functions

func IsAlreadyExists

func IsAlreadyExists(err error) bool

func IsInvalidCredentials

func IsInvalidCredentials(err error) bool

func IsNotFound

func IsNotFound(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
)

Jump to

Keyboard shortcuts

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