Exception in thread "main" com.powsybl.iidm.network.ValidationException: Load 'load1': connectable bus is not set
at com.powsybl.iidm.network.impl.TerminalBuilder.build(TerminalBuilder.java:65)
at com.powsybl.iidm.network.impl.AbstractInjectionAdder.checkAndGetTerminal(AbstractInjectionAdder.java:55)
at com.powsybl.iidm.network.impl.LoadAdderImpl.add(LoadAdderImpl.java:71)
at com.powsybl.iidm.network.impl.LoadAdderImpl.add(LoadAdderImpl.java:16)
NOTE: if you use the wrong node/connectablebus, you do get an exception just after:
com.powsybl.iidm.network.ValidationException: Load 'load1': voltage level S1VL1 has a node/breaker topology, a node connection should be specified instead of a bus connection
at com.powsybl.iidm.network.impl.NodeBreakerVoltageLevel.checkTerminal(NodeBreakerVoltageLevel.java:1109)
at com.powsybl.iidm.network.impl.NodeBreakerVoltageLevel.attach(NodeBreakerVoltageLevel.java:1125)
at com.powsybl.iidm.network.impl.LoadAdderImpl.add(LoadAdderImpl.java:80)
at com.powsybl.iidm.network.impl.LoadAdderImpl.add(LoadAdderImpl.java:16)
Describe the current behavior
errors with
should be Load 'load1': node is not set
In this line we use node == null to differentiate between busterminal and nodeterminal but we should use the voltage level topology instead https://github.com/powsybl/powsybl-core/blob/49bcb7643f01f9c979f0dfc662a0476fd1193ea7/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/TerminalBuilder.java#L65
NOTE: if you use the wrong node/connectablebus, you do get an exception just after:
Describe the expected behavior
get the correct exception the first time
Describe the motivation
simplicity
Extra Information
No response