forked from golang/hotime
28 lines
356 B
Go
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
|
|
}
|