Skip to content

Expose additional information about ParseErrors #979

@khieta

Description

@khieta

Category

Error message improvements

Describe the feature you'd like to request

#970 exposes ParseError in the public API as a struct with a private field. This means that users can do nothing with the resulting error beyond what is exposed through it's miette::Diagnostic implementation. So: they can print it out, see source location info, etc., but not match on the type of error (outside of matching on the error message text -- which we do not recommend!). We should expose the ParseError as an enum in accordance with #745. See EvaluationError and ValidationError for examples.

However, before we expose this error type there is some cleanup that needs to be done:

  1. Flatten the ParseError structure to remove the distinction between ToCST and ToAST errors. This distinction shouldn't matter from a user's perspective.
  2. Get rid of the Kind pattern since we've moved away from using this elsewhere in the code base (see Align EvaluationError and ExtensionFunctionLookupError with cedar#745 #860 and Flatten structs for validation errors and warnings #911).

Describe alternatives you've considered

No reponse

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestThis issue requets a substantial new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions