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

Better feedback when variable does not exist in FMU's modelDescription file #73

Open
THEvang opened this issue Jun 22, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@THEvang
Copy link
Member

THEvang commented Jun 22, 2020

When validating a OspModelDescription file defining a variable that does not exist in the FMU's modelDescription, the output is a java exception. I think the output should be a message explicitly telling what is wrong. For instance: Variable: A used in Variable Group: Group A, is not defined in modelDescription.xml of FMU: FMU A

The exception is shown below:

Exception in thread "main" java.lang.NullPointerException at com.opensimulationplatform.core.owlbuilder.VariableGroupOwlBuilder.setVariables(VariableGroupOwlBuilder.java:185) at com.opensimulationplatform.core.owlbuilder.VariableGroupOwlBuilder.build(VariableGroupOwlBuilder.java:140) at com.opensimulationplatform.core.owlbuilder.VariableGroupOwlBuilder.setVariableGroups(VariableGroupOwlBuilder.java:173) at com.opensimulationplatform.core.owlbuilder.VariableGroupOwlBuilder.build(VariableGroupOwlBuilder.java:141) at com.opensimulationplatform.core.owlbuilder.SimulatorOwlBuilder.lambda$setVariableGroups$5(SimulatorOwlBuilder.java:74) at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085) at com.opensimulationplatform.core.owlbuilder.SimulatorOwlBuilder.setVariableGroups(SimulatorOwlBuilder.java:68) at com.opensimulationplatform.core.owlbuilder.SimulatorOwlBuilder.build(SimulatorOwlBuilder.java:34) at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) at com.opensimulationplatform.core.owlbuilder.SystemStructureOwlBuilder.buildSimulators(SystemStructureOwlBuilder.java:49) at com.opensimulationplatform.core.owlbuilder.SystemStructureOwlBuilder.build(SystemStructureOwlBuilder.java:27) at com.opensimulationplatform.core.validation.ValidatorContextFactory.create(ValidatorContextFactory.java:26) at com.opensimulationplatform.core.validation.Validator.validate(Validator.java:75) at com.opensimulationplatform.cli.Validator.validate(Validator.java:66) at com.opensimulationplatform.cli.Main.main(Main.java:85)

@THEvang THEvang added the enhancement New feature or request label Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant