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

Throw a specialized Exception for Mandatory elements #31

Open
nkoester opened this issue Jan 11, 2023 · 0 comments
Open

Throw a specialized Exception for Mandatory elements #31

nkoester opened this issue Jan 11, 2023 · 0 comments

Comments

@nkoester
Copy link
Member

The MandatoryReferenceAccessor currently throws a RuntimeException when a mandatory reference is missing:

https://github.com/modelix/modelix.core/blob/main/metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/ReferenceAccessor.kt#L27

When propagating changes to clients, catching RuntimeException is too generic. We should be more specific here, for example by throwing our own, e.g. MandatoryReferenceMissingException.

This is also applicable to other parts in the code, for example:

https://github.com/modelix/modelix.core/blob/main/metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/ChildAccessor.kt#L24

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

No branches or pull requests

1 participant