// NewError creates new error instance.
NewError creates new error instance.
// NewError creates new error instance .
func NewError(code int, messages ...string) Error {
	statusErr := StatusError{Code: code}
	if len(messages) == 1 {
		statusErr.Message = messages[0]
	} else {
		statusErr.Messages = messages
	}
	return statusErr
}
func NewError ( code int , messages ... string ) Error { statusErr := StatusError { Code : code } if len ( messages ) == 1 { statusErr . Message = messages [ 0 ] } else { statusErr . Messages = messages } return statusErr }
NewError creates new error instance.
NewError creates new error instance .