Documentation ¶
Overview ¶
Package exceptions define a interface for Output Specific Errors of Internal Projects and Implementation of CommonException
Index ¶
Constants ¶
View Source
const CommonExceptionCode = 819
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommonException ¶
type CommonException struct {
// contains filtered or unexported fields
}
CommonException 是实现Exception接口的基础异常结构 常规异常可通过参数的不同直接实例化此结构来支持业务错误的定义 更高级的归类可嵌入结构体实现
func (*CommonException) Error ¶
func (e *CommonException) Error() string
Error 将异常信息输出为JSON字符串,以用于传输后的进一步处理
func (*CommonException) Message ¶
func (e *CommonException) Message() string
Message 获取异常所对应的错误业务异常消息
type Exception ¶
type Exception interface { // Error implementing golang's own error interface Error() string // Code gets the Code of exceptions, eg 1000001 Code() int // Message gets the message of exception Message() string }
Exception define a custom exceptions interfaces for tmi internal projects
Click to show internal directories.
Click to hide internal directories.