Documentation
¶
Index ¶
- func FormatDescription(s string, args ...interface{}) string
- func FormatInvalidParamterDetailDescription(s string, args ...interface{}) string
- func FormatStringDescription(s string, args ...interface{}) string
- func Is(erra, errb error) bool
- func IsCode(err error) bool
- type BatchError
- type ErrorCodeInfo
- type Module
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDescription ¶
FormatDescription replace the placeholder in coder.Description Example: Description: call service [service_name] api [api_name] error, args: basic-service, create => Description: call service [basic-service] api [create] error,
func FormatStringDescription ¶
Types ¶
type BatchError ¶
type BatchError struct {
// contains filtered or unexported fields
}
func (*BatchError) Add ¶
func (be *BatchError) Add(errs ...error)
func (*BatchError) Err ¶
func (be *BatchError) Err() error
Err returns an error that represents all errors.
func (*BatchError) NotNil ¶
func (be *BatchError) NotNil() bool
type ErrorCodeInfo ¶
type ErrorCodeInfo struct {
// contains filtered or unexported fields
}
func (*ErrorCodeInfo) Desc ¶
func (e *ErrorCodeInfo) Desc(args ...any) error
func (*ErrorCodeInfo) Err ¶
func (e *ErrorCodeInfo) Err() error
func (*ErrorCodeInfo) GetCode ¶
func (e *ErrorCodeInfo) GetCode() string
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) Cause ¶
func (m *Module) Cause(code, desc, cause string) *ErrorCodeInfo
Cause 该方法还必须在Module方法之后
func (*Module) Description ¶
func (m *Module) Description(code, desc string) *ErrorCodeInfo
Description 该方法还必须在Module方法之后
func (*Module) Solution ¶
func (m *Module) Solution(code, desc, cause, solution string) *ErrorCodeInfo
Solution 该方法还必须在Module方法之后
Click to show internal directories.
Click to hide internal directories.