MCPcopy Index your code
hub / github.com/crossplane-contrib/function-patch-and-transform / WrapFieldError

Function WrapFieldError

validate.go:12–21  ·  view source on GitHub ↗

WrapFieldError wraps the given field.Error adding the given field.Path as root of the Field.

(err *field.Error, path *field.Path)

Source from the content-addressed store, hash-verified

10
11// WrapFieldError wraps the given field.Error adding the given field.Path as root of the Field.
12func WrapFieldError(err *field.Error, path *field.Path) *field.Error {
13 if err == nil {
14 return nil
15 }
16 if path == nil {
17 return err
18 }
19 err.Field = path.Child(err.Field).String()
20 return err
21}
22
23// WrapFieldErrorList wraps the given field.ErrorList adding the given field.Path as root of the Field.
24func WrapFieldErrorList(errs field.ErrorList, path *field.Path) field.ErrorList {

Callers 9

WrapFieldErrorListFunction · 0.85
ValidateResourcesFunction · 0.85
ValidateComposedTemplateFunction · 0.85
ValidatePatchSetFunction · 0.85
ValidateEnvironmentFunction · 0.85
ValidateReadinessCheckFunction · 0.85
ValidatePatchFunction · 0.85
ValidateTransformFunction · 0.85
ValidateMatchTransformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected