hotime/common/error.go
2021-05-25 20:27:24 +08:00

28 lines
370 B
Go

package common
import (
"github.com/sirupsen/logrus"
)
// Error 框架层处理错误
type Error struct {
*logrus.Logger
error
}
func (that *Error) GetError() error {
return that.error
}
func (that *Error) SetError(err error) {
that.error = err
if that.Logger != nil && err != nil {
//that.Logger=log.GetLog("",false)
that.Logger.Warn(err)
}
return
}