You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
513 B
Go

/**
* @Author: Echo
* @Email:1711788888@qq.com
* @Date: 2021/8/27 1:12
* @Desc: TODO
*/
package core
type Error interface {
error
Code() int
Message() string
}
type respError struct {
code int
message string
}
func NewError(code int, message string) Error {
return &respError{
code: code,
message: message,
}
}
func (e *respError) Error() string {
return e.message
}
func (e *respError) Code() int {
return e.code
}
func (e *respError) Message() string {
return e.message
}