cel-go icon indicating copy to clipboard operation
cel-go copied to clipboard

Make Errors more useful

Open JimLarson opened this issue 6 years ago • 0 comments

Feature request checklist

  • [ ] There are no issues that match the desired change
  • [X] The change is large enough it can't be addressed with a simple Pull Request
  • [ ] If this is a bug, please file a Bug Report.

Change

Have an Error method to obtain the raw offset (or range?) for the error, in addition to the line and column, to make it more useful when the caller embeds the CEL expression in a larger document and would like to translate errors back to the original context.

Furthermore, Error.ToDisplayString takes a Source argument, but in the case where Env.Parse() fails, we don't necessarily have an Ast to obtain the Source from, so you currently need to go outside the 'cel' package API in order to translate Issues into nice display strings.

JimLarson avatar Mar 20 '19 18:03 JimLarson