Skip to content

Commit

Permalink
修改错误返回
Browse files Browse the repository at this point in the history
修改错误返回为*Error
  • Loading branch information
magiclvzs committed Nov 20, 2018
1 parent f7fd67f commit ba06db1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func (r *Error) Error() string {
return r.Str
}

var idErrMap = map[uint16]error{}
var idErrMap = map[uint16]*Error{}
var errIdMap = map[error]uint16{}

func NewError(str string, id uint16) *Error {
Expand Down Expand Up @@ -51,7 +51,7 @@ var (

var MinUserError = 256

func GetError(id uint16) error {
func GetError(id uint16) *Error {
if e, ok := idErrMap[id]; ok {
return e
}
Expand Down

0 comments on commit ba06db1

Please sign in to comment.