cedar-policy / cedar

Implementation of the Cedar Policy Language

Home Page:https://www.cedarpolicy.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change Result<T, impl miette::Diagnostic> to Result<T, E>

iamsauravsharma opened this issue · comments

Category

User level API features/changes

Describe the feature you'd like to request

Currently some api returns Result<T, impl miette::Diagnostic> instead of Result<T, E> convert all methods for better consistency as well as it is easier to work with Result<T, E>
Currently 4 methods returns Result<T, impl miette::Diagnostic>

  1. https://docs.rs/cedar-policy/latest/cedar_policy/struct.Entity.html#method.attr
  2. https://docs.rs/cedar-policy/latest/cedar_policy/struct.EntityUid.html#method.from_json
  3. https://docs.rs/cedar-policy/latest/cedar_policy/struct.Template.html#method.to_json
  4. https://docs.rs/cedar-policy/latest/cedar_policy/struct.Policy.html#method.to_json

Describe alternatives you've considered

None

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

Somewhat related to #695. I think the comment there is relevant.

Basically, we're looking to rework error types in a 4.0 release, but we can consider non-breaking changes before that.