// NewErrorSuppress node constructor
327994
func NewErrorSuppress(Expression node.Node) *ErrorSuppress {
	return &ErrorSuppress{
		FreeFloating: nil,
		Expr:         Expression,
	}
}
545571
func NewError(code ErrorCode, node string) error {
	var message string
	switch code {
	case NodeExists:
		message = fmt.Sprintf("node already exists: %s", node)
	case NoNode:
		message = fmt.Sprintf("node doesn't exist: %s", node)
	case NodeNotEmpty:
		message = fmt.Sprintf("node not empty: %s", node)
	case Timeout:
		message = fmt.Sprintf("deadline exceeded: %s", node)
	case Interrupted:
		message = fmt.Sprintf("interrupted: %s", node)
	case BadVersion:
		message = fmt.Sprintf("bad node version: %s", node)
	case PartialResult:
		message = fmt.Sprintf("partial result: %s", node)
	case NoUpdateNeeded:
		message = fmt.Sprintf("no update needed: %s", node)
	case NoImplementation:
		message = fmt.Sprintf("no such topology implementation %s", node)
	default:
		message = fmt.Sprintf("unknown code: %s", node)
	}
	return Error{
		code:    code,
		message: message,
	}
}
774273
func NewErrorEvent(e ExitCode) *omaha.EventRequest {
	return &omaha.EventRequest{
		Type:      omaha.EventTypeUpdateComplete,
		Result:    omaha.EventResultError,
		ErrorCode: int(e),
	}
}
126331
func NewError(code int, s string) error {
	if code < 0 || code >= ErrCnt {
		panic("no such error code!")
	}
	r := &Error{
		err: s,
	}
	switch code {
	case ErrNotFound, ErrIO, ErrUnauthorized, ErrInvalidValue, ErrDataOverflow, ErrNothingToReturn, ErrInvalidSignature, ErrNotSynced, ErrPeriodDepth, ErrCorruptData:
		r.code = code
	}
	return r
}
944368
func NewError(statuscode int, msg string) *Error {
	return &Error{StatusCode: statuscode, Message: msg}
}
1184578
func NewErrorInvalidHost(h string, d string, n map[string]string) ErrorInvalidHost {
	return ErrorInvalidHost{host: h, ds: d, nw: n}
}
1332434
func replyError(c context.Context, rw http.ResponseWriter, err error, msg string, args ...interface{}) {
	code := http.StatusBadRequest
	if transient.Tag.In(err) {
		code = http.StatusInternalServerError
	}
	msg = fmt.Sprintf(msg, args...)
	logging.Errorf(c, "HTTP %d: %s", code, msg)
	http.Error(rw, msg, code)
}
1200949
func NewErrorResponse(message string, code int) Response {
	return Response{
		Success:  false,
		Result:   nil,
		Errors:   []ResponseMessage{{code, message}},
		Messages: []ResponseMessage{},
	}
}
258859
func NewError(code string, loc *Location, f string, a ...interface{}) *Error {
	return &Error{
		Code:     code,
		Location: loc,
		Message:  fmt.Sprintf(f, a...),
	}
}
1315018
func NewError(code int, msg string) *Error {
	return &Error{
		Code:    code,
		Message: msg}
}
123063
func NewLocatedError(err interface{}, nodes []ast.Node) *Error {
	var origError error
	message := "An unknown error occurred."
	if err, ok := err.(error); ok {
		message = err.Error()
		origError = err
	}
	if err, ok := err.(string); ok {
		message = err
		origError = errors.New(err)
	}
	stack := message
	return NewError(
		message,
		nodes,
		stack,
		nil,
		[]int{},
		origError,
	)
}
1064501
func NewResponseError(resp *sawyer.Response) (err *ResponseError) {
	err = &ResponseError{}

	e := resp.Decode(&err)
	if e != nil {
		err.Message = fmt.Sprintf("Problems parsing error message: %s", e)
	}

	err.Response = resp.Response
	err.Type = getResponseErrorType(err)
	return
}
784666
func newError(pos ast.Pos, err error) error {
	if err == nil {
		return nil
	}
	if pos == nil {
		return &Error{Message: err.Error(), Pos: ast.Position{Line: 1, Column: 1}}
	}
	return &Error{Message: err.Error(), Pos: pos.Position()}
}
72093
func ValidateEndpointsUpdate(newEndpoints, oldEndpoints *api.Endpoints) field.ErrorList {
	allErrs := ValidateObjectMetaUpdate(&newEndpoints.ObjectMeta, &oldEndpoints.ObjectMeta, field.NewPath("metadata"))
	allErrs = append(allErrs, validateEndpointSubsets(newEndpoints.Subsets, field.NewPath("subsets"))...)
	return allErrs
}
907418
func NewError(source, title,path,description string) *Error {
	return &Error {
		SourceType:source,
		Title:title,
		Path:path,
		Description:description,
	}
}
361153
func NewErrorResponse(code int, err interface{}, context string) *ErrorResponse {
	var msg string

	switch err := err.(type) {
	case error:
		msg = err.Error()
	case string:
		msg = err
	default:
		return nil
	}

	return &ErrorResponse{
		Err: []APIError{
			{
				Code:          code,
				InternalError: code == 500,
				Msg:           msg,
				Context:       context,
			},
		},
	}
}
561327
func NewError(cause error, msg string) error {
	if cause != nil {
		return &pcError{
			ErrorNode: ErrorNode{}.Initialize(cause, 3),
			msg:       msg,
		}
	}
	return &pcErrorNoCause{
		ErrorNodeNoCause: ErrorNodeNoCause{}.Initialize(3),
		msg:              msg,
	}
}