iedc-go/common/error.go
2021-05-25 19:53:34 +08:00

28 lines
356 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 {
//that.Logger=log.GetLog("",false)
that.Logger.Warn(err)
}
return
}