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

Function ErrorAsIssues

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

1060// This is a convenience method for early returning from an expression validation call path due to
1061// internal state or configuration which is unrelated to the source being validated.
1062func ErrorAsIssues(err error) *Issues {
1063 errs := common.NewErrors(common.NewTextSource(""))
1064 errs.ReportErrorString(common.NoLocation, err.Error())
1065 return NewIssues(errs)
1066}
1067
1068// NewIssues returns an Issues struct from a common.Errors object.
1069func 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