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

Function ErrorAsIssues

cel/env.go:972–976  ·  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

970// This is a convenience method for early returning from an expression validation call path due to
971// internal state or configuration which is unrelated to the source being validated.
972func ErrorAsIssues(err error) *Issues {
973 errs := common.NewErrors(common.NewTextSource(""))
974 errs.ReportErrorString(common.NoLocation, err.Error())
975 return NewIssues(errs)
976}
977
978// NewIssues returns an Issues struct from a common.Errors object.
979func 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