1
0
Fork 0
forked from 0x2E/fusion
fusion/server/error.go
2024-03-12 22:57:53 +08:00

20 lines
364 B
Go

package server
// BizError is the error allowed to show on frontend user side
type BizError struct {
HTTPCode uint
FEMessage string
Raw error
}
func (e BizError) Error() string {
return e.Raw.Error()
}
func NewBizError(raw error, code uint, message string) BizError {
return BizError{
HTTPCode: code,
FEMessage: message,
Raw: raw,
}
}