Skip to content

fix(concerto-core): throw IllegalModelException in getNestedProperty for primitive or enum - #1629

Open
charuishere wants to merge 1 commit into
accordproject:mainfrom
charuishere:charuishere/i1627/illegal-model-exception
Open

charuishere wants to merge 1 commit into
accordproject:mainfrom
charuishere:charuishere/i1627/illegal-model-exception

Conversation

@charuishere

Copy link
Copy Markdown

Closes #1627

getNestedProperty() was throwing a normal Error when the path goes through a primitive or enum property (like outerAsset.int.innerAsset). The docs say it throws IllegalModelException so I changed it to throw that instead

Changes

  • Replaced Error with IllegalModelException in getNestedProperty() (same way as the "property does not exist" case in that method)
  • Updated the existing primitives test to check for IllegalModelException

Flags

  • The message is the same, only the exception type changed
  • concerto-core tests pass. One ESM check in the build showed a timezone mismatch, which looks unrelated to this change.

Screenshots or Video

N/A

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

…for primitive or enum

Closes accordproject#1627

Signed-off-by: Charukesh <charuu.g21@gmail.com>
@mira-accord-project

Copy link
Copy Markdown

Thanks for this fix, and for picking up #1627 so quickly.

What happens next: the concerto maintainers have been asked to review this PR. This is a first-time contribution, so the test workflows need a maintainer's approval before they run. Once they do, the results will show on this PR.

For the maintainers' information: #1628 (from Atharva15007) is also open and makes the same change to getNestedProperty() for #1627. They will look at both PRs and decide which one to take forward, so there is nothing you need to do for now.

Drafted by an Accord Project agent, reviewed by a maintainer.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClassDeclaration.getNestedProperty() throws generic Error instead of IllegalModelException for primitive or enum properties

1 participant