Documentation ¶
Overview ¶
@Author: Ciusyan 2023/2/7
@Author: Ciusyan 2023/2/13
Index ¶
- func Err(c int32, msg string) error
- func Errorf(c int32, format string, a ...interface{}) error
- func GinErrWrapper(handler AppHandler) func(c *gin.Context)
- func GrpcErrWrapper(err error) *custom.Exception
- func WithCodeMsg(codeMsg *custom.CodeMsg) *custom.Exception
- func WithDetails(code int32, msg string, details ...interface{}) *custom.Exception
- func WithStatusCode(code constant.StatusCode) *custom.Exception
- func WithStatusMsg(msg string) *custom.Exception
- func WithStatusMsgf(format string, a ...any) *custom.Exception
- type AppHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinErrWrapper ¶
func GinErrWrapper(handler AppHandler) func(c *gin.Context)
GinErrWrapper 用于统一处理控制层 error
func GrpcErrWrapper ¶
GrpcErrWrapper 用于包装 GPRC 调用产生的 err
func WithCodeMsg ¶
WithCodeMsg 传递CodeMsg
func WithDetails ¶
WithDetails 传递Details
func WithStatusCode ¶
func WithStatusCode(code constant.StatusCode) *custom.Exception
func WithStatusMsg ¶
Types ¶
type AppHandler ¶
Click to show internal directories.
Click to hide internal directories.