MCPcopy Create free account
hub / github.com/cel-expr/cel-go / ErrorAsIssues

Function ErrorAsIssues

cel/env.go:1184–1188  ·  view source on GitHub ↗

ErrorAsIssues wraps a Golang error into a CEL common error and issue set. This is a convenience method for early returning from an expression validation call path due to internal state or configuration which is unrelated to the source being validated.

(err error)

Source from the content-addressed store, hash-verified

1182// This is a convenience method for early returning from an expression validation call path due to
1183// internal state or configuration which is unrelated to the source being validated.
1184func ErrorAsIssues(err error) *Issues {
1185 errs := common.NewErrors(common.NewTextSource(""))
1186 errs.ReportErrorString(common.NoLocation, err.Error())
1187 return NewIssues(errs)
1188}
1189
1190// NewIssues returns an Issues struct from a common.Errors object.
1191func NewIssues(errs *common.Errors) *Issues {

Callers 3

CompileMethod · 0.85
ParseMethod · 0.85
TestErrorAsIssuesFunction · 0.85

Calls 5

ReportErrorStringMethod · 0.95
NewErrorsFunction · 0.92
NewTextSourceFunction · 0.92
NewIssuesFunction · 0.85
ErrorMethod · 0.45

Tested by 1

TestErrorAsIssuesFunction · 0.68