exceptions

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 6 Imported by: 27

Documentation

Index

Constants

View Source
const (
	// Success
	SCFileDownload = ""
	SCSuccess      = "0"

	// User return error
	ErrCodeFunctionError   = "k_cf_ec_100001" // 函数错误
	ErrCodeValidationError = "k_cf_ec_100002" // 校验错误

	// User business error
	ErrCodeDeveloperError = "k_cf_ec_400001783"

	// System error
	ErrCodeInternalError = "k_cf_ec_200001" // 内部系统错误

	// For developer error code
	// 无权限操作流程
	ErrCodeFlowNoPermission = "k_wf_ec_200036"
	// 流程不存在
	ErrCodeFlowNotExist = "k_wf_ec_2001006"
	// 流程实例 ID 不存在
	ErrCodeFlowExecutionNotExist = "k_wf_ec_2001005"
	// 不支持调用此类型流程
	ErrCodeFlowNotSupportCallFlowType = "k_wf_ec_2001004"
	// 不支持撤销该流程 (无人工任务)
	ErrCodeFlowNotSupportRevokeFlow = "k_wf_ec_2001003"
	// 缺少流程的必填参数
	ErrCodeFlowNoReqInputParam = "k_wf_ec_2001002"
	// 流程参数中 APIName 无效
	ErrCodeFlowInvalidParam = "k_wf_ec_2001001"
	// 记录不存在
	ErrCodeDataRecordNotFound = "k_cf_ec_300004"

	// Deprecated
	ErrCodeRateLimitError = "k_cf_ec_200009" // 限流错误
	// Deprecated
	ECOpenAPIRateLimitError = "k_op_ec_20003"
	// Deprecated
	ECFaaSInfraRateLimitError = "k_fs_ec_000004"
	// Deprecated
	ErrCodeInvalidParams = "k_cf_ec_300001" // 请求参数错误
	// Deprecated
	ECUnknownError = "k_ec_000004"
	// Deprecated
	ECOpUnknownError = "k_op_ec_00001"
	// Deprecated
	ECSystemBusy = "k_op_ec_20001"
	// Deprecated
	ECSystemError = "k_op_ec_20002"
	// Deprecated
	FaaSInfraFailCodeMissingToken = "k_fs_ec_100001"
	// Deprecated
	ECTokenExpire = "k_ident_013000"
	// Deprecated
	ECIllegalToken = "k_ident_013001"
	// Deprecated
	ECMissingToken = "k_op_ec_10205"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseError

type BaseError struct {
	Code    string   `json:"code"`
	Message string   `json:"message"`
	Types   []string `json:"types"`
	// contains filtered or unexported fields
}

func DeveloperError

func DeveloperError(format string, args ...interface{}) *BaseError

func ErrWrap

func ErrWrap(err error) *BaseError

func InternalError

func InternalError(format string, args ...interface{}) *BaseError

func InvalidParamError

func InvalidParamError(format string, args ...interface{}) *BaseError

func NewErrWithCode

func NewErrWithCode(code, format string, args ...interface{}) *BaseError

Deprecated

func NewErrWithCodeV2 added in v0.0.22

func NewErrWithCodeV2(code, msg, logid string) *BaseError

func ParseBaseError added in v0.0.23

func ParseBaseError(err error) (baseError *BaseError, ok bool)

func ParseErrForUser

func ParseErrForUser(err error) *BaseError

func (*BaseError) Error

func (e *BaseError) Error() string

func (*BaseError) Format

func (e *BaseError) Format(st fmt.State, verb rune)

func (*BaseError) GetErr added in v0.0.23

func (e *BaseError) GetErr() error

type Frame

type Frame uintptr

Frame represents a program counter inside a stack frame.

func (Frame) Format

func (f Frame) Format(s fmt.State, verb rune)

Format formats the frame according to the fmt.Formatter interface.

%s    source file
%d    source line
%n    function name
%v    equivalent to %s:%d

Format accepts flags that alter the printing of some verbs, as follows:

%+s   function name and path of source file relative to the compile time
      GOPATH separated by \n\t (<funcname>\n\t<path>)
%+v   equivalent to %+s:%d

type StackTrace

type StackTrace []Frame

StackTrace is stack of Frames from innermost (newest) to outermost (oldest).

func (StackTrace) Format

func (st StackTrace) Format(s fmt.State, verb rune)

Format formats the stack of Frames according to the fmt.Formatter interface.

%s	lists source files for each Frame in the stack
%v	lists the source file and line number for each Frame in the stack

Format accepts flags that alter the printing of some verbs, as follows:

%+v   Prints filename, function, and line number for each Frame in the stack.

Jump to

Keyboard shortcuts

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