// Problem exists between keyboard and chair. This function is used in cases of
// programmer error, i.e. an inappropriate use of the param library, to
// immediately force the program to halt with a hopefully helpful error message.
160628
func pebkac(format string, a ...interface{}) {
	err := errors.New(errPrefix + fmt.Sprintf(format, a...) + yourFault)
	if pebkacTesting {
		panic(err)
	} else {
		log.Fatal(err)
	}
}
139927
func (e *ErrorObject) Error() string {
	return fmt.Sprintf("Error: %s %s\n", e.Title, e.Detail)
}
656370
func CheckPathConflicts(c *Compiler, exists func([]string) (bool, error)) Errors {
	var errs Errors

	root := c.RuleTree.Child(DefaultRootDocument.Value)
	if root == nil {
		return nil
	}

	for _, node := range root.Children {
		errs = append(errs, checkDocumentConflicts(node, exists, nil)...)
	}

	return errs
}
1109908
func (e errConfigurationInvalid) Error() string {
	return fmt.Sprintf("invalid configuration: %v", utilerrors.NewAggregate(e).Error())
}
606785
func (cmd *Cmd) help(line string) (stop bool) {
	fmt.Println("")

	if line == "--all" {
		fmt.Println("Available commands (use 'help <topic>'):")
		fmt.Println("================================================================")
		for _, c := range cmd.commandNames {
			fmt.Printf("%v: ", c)
			cmd.Commands[c].HelpFunc()
		}
	} else if len(line) == 0 {
		fmt.Println("Available commands (use 'help <topic>'):")
		fmt.Println("================================================================")

		max := 0

		for _, c := range cmd.commandNames {
			if len(c) > max {
				max = len(c)
			}
		}

		tp := pretty.NewTabPrinter(80 / (max + 1))
		tp.TabWidth(max + 1)

		for _, c := range cmd.commandNames {
			tp.Print(c)
		}
		tp.Println()
	} else {
		if c, ok := cmd.Commands[line]; ok {
			c.HelpFunc()
		} else {
			fmt.Println("unknown command or function")
		}
	}

	fmt.Println("")
	return
}
172669
func (e *DanglingEdgeError) Error() string {
	rel := ""
	if e.Edge.Title != "" {
		rel = fmt.Sprintf(" in %q", e.Edge.Title)
	}

	// TODO(vadimsh): Improve error messages.
	hasP := e.Edge.Parent.Declared()
	hasC := e.Edge.Child.Declared()
	switch {
	case hasP && hasC:
		// This should not happen.
		return "incorrect DanglingEdgeError, the edge is fully connected"
	case !hasP && hasC:
		return fmt.Sprintf("%s%s refers to undefined %s",
			e.Edge.Child, rel, e.Edge.Parent)
	case hasP && !hasC:
		return fmt.Sprintf("%s%s refers to undefined %s",
			e.Edge.Parent, rel, e.Edge.Child)
	default:
		return fmt.Sprintf("relation %q: refers to %s and %s, neither is defined",
			e.Edge.Title, e.Edge.Parent, e.Edge.Child)
	}
}
1245980
func (e *Error) Error() string {
	line, column, context := e.Position()
	return fmt.Sprintf("parse error:%d:%d: %s\n%s", line, column, e.Message, context)
}
1325063
func (tkn *Tokenizer) Error(err string) {
	buf := &bytes2.Buffer{}
	if tkn.lastToken != nil {
		fmt.Fprintf(buf, "%s at position %v near '%s'", err, tkn.Position, tkn.lastToken)
	} else {
		fmt.Fprintf(buf, "%s at position %v", err, tkn.Position)
	}
	tkn.LastError = errors.New(buf.String())

	// Try and re-sync to the next statement
	tkn.skipStatement()
}
1043928
func (e ParameterRequiredError) Error() string {
	return fmt.Sprintf(`"%s" is required in "%s"`, e.ParameterName, e.ParentName)
}
742808
func (v *Error) ErrorBody() string {
	var s string
	switch v.Type {
	case ErrorTypeRequired, ErrorTypeForbidden, ErrorTypeTooLong, ErrorTypeInternal:
		s = v.Type.String()
	default:
		value := v.BadValue
		valueType := reflect.TypeOf(value)
		if value == nil || valueType == nil {
			value = "null"
		} else if valueType.Kind() == reflect.Ptr {
			if reflectValue := reflect.ValueOf(value); reflectValue.IsNil() {
				value = "null"
			} else {
				value = reflectValue.Elem().Interface()
			}
		}
		switch t := value.(type) {
		case int64, int32, float64, float32, bool:
			// use simple printer for simple types
			s = fmt.Sprintf("%s: %v", v.Type, value)
		case string:
			s = fmt.Sprintf("%s: %q", v.Type, t)
		case fmt.Stringer:
			// anything that defines String() is better than raw struct
			s = fmt.Sprintf("%s: %s", v.Type, t.String())
		default:
			// fallback to raw struct
			// TODO: internal types have panic guards against json.Marshalling to prevent
			// accidental use of internal types in external serialized form.  For now, use
			// %#v, although it would be better to show a more expressive output in the future
			s = fmt.Sprintf("%s: %#v", v.Type, value)
		}
	}
	if len(v.Detail) != 0 {
		s += fmt.Sprintf(": %s", v.Detail)
	}
	return s
}
213325
func (e *Error) Error() string {
	var b strings.Builder

	// Print the current operation in our stack, if any.
	if e.Op != "" {
		fmt.Fprintf(&b, "%s: ", e.Op)
	}

	// If wrapping an error, print its Error() message.
	// Otherwise print the error code & message.
	if e.Err != nil {
		b.WriteString(e.Err.Error())
	} else {
		if e.Code != "" {
			fmt.Fprintf(&b, "<%s>", e.Code)
			if e.Msg != "" {
				b.WriteString(" ")
			}
		}
		b.WriteString(e.Msg)
	}
	return b.String()
}
408847
func (sp *SendAudio) KeyboardHide(kb ReplyKeyboardHide) *SendAudio {
	var rmi ReplyMarkupInt = kb
	sp.ReplyMarkup = &rmi
	return sp
}
262729
func (v *Error) ErrorBody() string {
	var s string
	switch v.Type {
	case ErrorTypeRequired, ErrorTypeForbidden, ErrorTypeTooLong, ErrorTypeInternal:
		s = fmt.Sprintf("%s", v.Type)
	default:
		var bad string
		badBytes, err := json.Marshal(v.BadValue)
		if err != nil {
			bad = err.Error()
		} else {
			bad = string(badBytes)
		}
		s = fmt.Sprintf("%s: %s", v.Type, bad)
	}
	if len(v.Detail) != 0 {
		s += fmt.Sprintf(": %s", v.Detail)
	}
	return s
}
1236295
func (s *CommandStatus) Error() error {
	if s.Status == ok {
		return nil
	}

	return fmt.Errorf("command error on %s: %s",
		s.ReferenceName.String(), s.Status)
}
530675
func (t *TimeoutError) Error() string {
	if len(t.message) > 0 {
		return fmt.Sprintf("%s timed out after %v", t.message, t.after)
	}
	return fmt.Sprintf("function timed out after %v", t.after)
}
769553
func (err getError) Error() string {
	switch err.Reason {
	case ErrSectionNotFound:
		return fmt.Sprintf("section '%s' not found", err.Name)
	case ErrKeyNotFound:
		return fmt.Sprintf("key '%s' not found", err.Name)
	}
	return "invalid get error"
}
834050
func (e *ErrLocked) Error() string {
	return fmt.Sprintf("key is locked, key: %q, primary: %q, txnStartTS: %v", e.Key, e.Primary, e.StartTS)
}