MCPcopy Create free account
hub / github.com/goadesign/goa / Error

Method Error

eval/eval.go:148–159  ·  view source on GitHub ↗

Error implements the error interface.

()

Source from the content-addressed store, hash-verified

146
147// Error implements the error interface.
148func (verr *ValidationErrors) Error() string {
149 msg := make([]string, len(verr.Errors))
150 for i, err := range verr.Errors {
151 expr := verr.Expressions[i]
152 if file, line, ok := validationErrorLocation(expr); ok {
153 msg[i] = fmt.Sprintf("[%s:%d] %s: %s", file, line, expr.EvalName(), err)
154 } else {
155 msg[i] = fmt.Sprintf("%s: %s", expr.EvalName(), err)
156 }
157 }
158 return strings.Join(msg, "\n")
159}
160
161// Merge merges validation errors into the target.
162func (verr *ValidationErrors) Merge(err *ValidationErrors) {

Calls 2

validationErrorLocationFunction · 0.85
EvalNameMethod · 0.65