iedc-go/vendor/code.hoteas.com/golang/hotime/common/error.go

28 lines
377 B
Go
Raw Permalink Normal View History

2023-03-02 19:12:15 +00:00
package common
import (
"github.com/sirupsen/logrus"
)
// Error 框架层处理错误
type Error struct {
Logger *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
}