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)
| 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. |
| 1184 | func 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. |
| 1191 | func NewIssues(errs *common.Errors) *Issues { |