hotime/error.go

26 lines
313 B
Go
Raw Normal View History

2017-08-04 08:20:59 +00:00
package hotime
//框架层处理错误
type Error struct {
error
2017-08-04 08:20:59 +00:00
err error
}
func (this *Error) GetError() error {
2017-08-04 08:20:59 +00:00
return this.error
2017-08-04 08:20:59 +00:00
}
func (this *Error) SetError(err error, loglevel ...int) {
2017-08-04 08:20:59 +00:00
this.error = nil
if err == nil {
this.error = err
this.err = err
2018-04-03 17:54:27 +00:00
return
}
this.error = err
return
2017-08-04 08:20:59 +00:00
}