// NewError creates a new status error by optionally wrapping another error.
NewError creates a new status error by optionally wrapping another error.
// NewError creates a new status error by optionally wrapping another error .
func NewError(err error, code int, msg string, args ...interface{}) error {
	if msg == "" {
		msg = strings.ToLower(http.StatusText(code))
	}
	return &statusError{
		code:    code,
		Message: fmt.Sprintf(msg, args...),
		err:     err,
	}
}
func NewError ( err error , code int , msg string , args ... interface { } ) error { if msg == " " { msg = strings . ToLower ( http . StatusText ( code ) ) } return & statusError { code : code , Message : fmt . Sprintf ( msg , args ... ) , err : err , } }
NewError creates a new status error by optionally wrapping another error.
NewError creates a new status error by optionally wrapping another error .