upp/pkg/api/error.go
2024-12-31 18:02:40 +08:00

17 lines
243 B
Go

package api
import "strconv"
type Err struct {
Status int
Msg string
}
func (n Err) Error() string {
return strconv.Itoa(n.Status) + " " + n.Msg
}
func NewNFError(status int, msg string) Err {
return Err{Status: status, Msg: msg}
}