status

package
v0.10.8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: BSD-3-Clause Imports: 1 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(errorType Type, format string, a ...interface{}) error

Errorf returns Error(ErrorType, fmt.Sprintf(format, a...)).

Types

type Error

type Error struct {
	ErrorType Type
	Message   string
}

Error is an internal error

func FromError

func FromError(err error) (s *Error, ok bool)

FromError returns Error, true if the provided error is of type of Error. nil, false otherwise

func (*Error) Error

func (e *Error) Error() string

Error is an error string

func (*Error) Type

func (e *Error) Type() Type

Type returns the Type of the error

type Type

type Type int32

Type is a type of the Error

const (
	// UserAlreadyExists indicates that user already exists
	UserAlreadyExists Type = 1

	// PreconditionFailed indicates that some pre-condition for the operation hasn't been fulfilled
	PreconditionFailed Type = 2

	// PermissionDenied indicates that user has no permissions to view data
	PermissionDenied Type = 3

	// NotFound indicates that the object wasn't found in the system (or under a given Account)
	NotFound Type = 4

	// Internal indicates some generic internal error
	Internal Type = 5

	// InvalidArgument indicates some generic invalid argument error
	InvalidArgument Type = 6

	// AlreadyExists indicates a generic error when an object already exists in the system
	AlreadyExists Type = 7

	// Unauthorized indicates that user is not authorized
	Unauthorized Type = 8

	// BadRequest indicates that user is not authorized
	BadRequest Type = 9
)

Jump to

Keyboard shortcuts

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