增加ToError方法
This commit is contained in:
@ -41,6 +41,13 @@ func (e *Exception) GetHttpCode() int {
|
||||
return e.httpCode
|
||||
}
|
||||
|
||||
func (e *Exception) ToError() error {
|
||||
if nil == e {
|
||||
return nil
|
||||
}
|
||||
return errors.New(e.Error())
|
||||
}
|
||||
|
||||
// NewWithCode 仅使用错误码实例化异常
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
|
Reference in New Issue
Block a user