mirror of
https://github.com/pyihe/go-pkg.git
synced 2025-10-09 18:00:06 +08:00
errors
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DefaultErrCode ErrorCode = -1
|
DefaultErrCode ErrorCode = 100000
|
||||||
)
|
)
|
||||||
|
|
||||||
type ErrorCode int64
|
type ErrorCode int64
|
||||||
|
@@ -39,7 +39,7 @@ func (e *_err) Error() string {
|
|||||||
if e == nil {
|
if e == nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("err: %d-%s", e.code, e.msg)
|
return fmt.Sprintf("code: %d err: %s", e.code, e.msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *_err) Code() ErrorCode {
|
func (e *_err) Code() ErrorCode {
|
||||||
|
Reference in New Issue
Block a user