Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More tasks from #745 #1036

Closed
wants to merge 5 commits into from
Closed

More tasks from #745 #1036

wants to merge 5 commits into from

Conversation

aaronjeline
Copy link
Contributor

@aaronjeline aaronjeline commented Jul 2, 2024

Description of changes

Cleans up two remaining error tasks

  • EntityUid::from_json returns a concrete type instead of an existential
  • HumanSchemaError::Parse is more transparent

Issue #, if available

#745

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

  • A backwards-compatible change requiring a minor version bump to cedar-policy (e.g., addition of a new API).

I confirm that this PR (choose one, and delete the other options):

  • Does not update the CHANGELOG because my change does not significantly impact released code.

I confirm that cedar-spec (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar formal model or DRT infrastructure.

Signed-off-by: Aaron Eline <aeline+github@amazon.com>
@aaronjeline aaronjeline marked this pull request as ready for review July 2, 2024 17:17
@aaronjeline aaronjeline requested review from cdisselkoen and khieta and removed request for cdisselkoen July 2, 2024 17:17
cedar-policy-validator/src/err.rs Outdated Show resolved Hide resolved
cedar-policy/src/api/err.rs Show resolved Hide resolved
cedar-policy/src/api/id.rs Outdated Show resolved Hide resolved
Signed-off-by: Aaron Eline <aeline+github@amazon.com>
Signed-off-by: Aaron Eline <aeline+github@amazon.com>
@aaronjeline aaronjeline requested a review from cdisselkoen July 3, 2024 13:10
Signed-off-by: Aaron Eline <aeline+github@amazon.com>
Signed-off-by: Aaron Eline <aeline+github@amazon.com>
Comment on lines +556 to 557
/// Creates a duplicate keys error
pub fn duplicate_keys(key: SmolStr, loc1: Loc, loc2: Loc) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this type is publicly exposed, end-users can see and use these constructors, and we have to commit to stability for their arguments. I think it would be better if we could avoid (at least fully pub) constructors, so that in the future we could add or change arguments as necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. I think our error constructors are generally not public

cedar-policy-validator/src/human_schema/err.rs Outdated Show resolved Hide resolved
Comment on lines +556 to 557
/// Creates a duplicate keys error
pub fn duplicate_keys(key: SmolStr, loc1: Loc, loc2: Loc) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. I think our error constructors are generally not public

cedar-policy/src/api/err.rs Show resolved Hide resolved
@khieta khieta changed the title More tasks from #754 More tasks from #745 Jul 30, 2024
@aaronjeline
Copy link
Contributor Author

Superseded by #1129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants