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