app_code

package
v0.0.0-...-cfca2e5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppErrorRoot = New("root", "root error")

Functions

This section is empty.

Types

type AppError

type AppError struct {
	Code    CodeType
	Message string
}

func New

func New(errType CodeType, message string) *AppError

func WithError

func WithError(errType CodeType, err error) *AppError

func (AppError) Error

func (e AppError) Error() string

type CodeType

type CodeType string
const (
	Success                CodeType = "success"
	ErrorUserNotFound      CodeType = "user_not_found"
	ErrorUserPassword      CodeType = "password_error"
	ErrorServerError       CodeType = "service_error"
	ErrorAuthFailed        CodeType = "auth_failed"
	ErrorWxAuthFailed      CodeType = "wx_auth_failed"
	ErrorTokenNotSet       CodeType = "token_not_set"
	ErrorRepeat            CodeType = "repeat"
	ErrorTokenTimeout      CodeType = "token_timeout"
	ErrorForbidden         CodeType = "forbidden"
	ErrorUserExist         CodeType = "user_exist"
	ErrorUpdateUserSetting CodeType = "update_user_setting"
	ErrorGetUserSetting    CodeType = "get_user_setting"
	ErrorTaskNotFound      CodeType = "task_not_found"
	ErrorTaskExist         CodeType = "task_exist"
	ErrorBadRequest        CodeType = "bad_request"
	ErrorNotImage          CodeType = "not_image"
	ErrorAuditParamInValid CodeType = "audit_param_invalid"
	ErrorNotFound          CodeType = "not_found"
	ErrorTaskRunNotFound   CodeType = "task_run_not_found"
	ErrorCreateTask        CodeType = "create_task"
)

Jump to

Keyboard shortcuts

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