errors

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS        = 200 //
	ERROR          = 500
	INVALID_PARAMS = 400

	ERROR_EXIST       = 10001
	ERROR_EXIST_FAIL  = 10002
	ERROR_NOT_EXIST   = 10003
	ERROR_GET_S_FAIL  = 10004
	ERROR_COUNT_FAIL  = 10005
	ERROR_CREATE_FAIL = 10006
	ERROR_UPDATE_FAIL = 10007
	ERROR_DELETE_FAIL = 10008
	ERROR_EXPORT_FAIL = 10009
	ERROR_IMPORT_FAIL = 10010

	ERROR_BASE_PATH = 10011

	ERROR_AUTH_CHECK_TOKEN_FAIL    = 20001
	ERROR_AUTH_CHECK_TOKEN_TIMEOUT = 20002
	ERROR_AUTH_TOKEN               = 20003
	ERROR_AUTH                     = 20004

	ERROR_FUNC_EVENT_ALREADY_EXISTS = 30001
	ERROR_FUNC_EVENT_NOT_CALL       = 30002
	ERROR_FUNC_EVENT_NOT_REGISTER   = 30003

	ERROR_REDIS_INIT_CONNECT_FAIL = 40001
	ERROR_REDIS_AUTH_FAIL         = 40002

	ERROR_CONFIG_INIT_FAIL             = 50001
	ERROR_CONTAINER_KEY_ALREADY_EXISTS = 50002
)

Variables

This section is empty.

Functions

func AddErrorMessage

func AddErrorMessage(code int, message string)

func AddErrorMessages

func AddErrorMessages(messages map[int]string)

func ErrorCode added in v0.0.3

func ErrorCode(name string) int

func ErrorMessage added in v0.0.3

func ErrorMessage(name string) string

func GetErrorMessage

func GetErrorMessage(code int) string

func New

func New(message string) error

func RegisterError added in v0.0.3

func RegisterError(name string, code int, message string)

func RegisterErrors added in v0.0.3

func RegisterErrors(errs []Error)

Types

type Error added in v0.0.3

type Error struct {
	Name    string `json:"-"`
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func MakeError added in v0.0.3

func MakeError(name string) *Error

Jump to

Keyboard shortcuts

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