Skip to content

Conversation

@sanjayankur31
Copy link
Member

We now check the error code returned by the command before printing
"successfully ran..". If there's an error in the command, because of a
malformed dot file for example, we will print the stderr messages for
the user and clearly state that the command failed.

So, instead of this:

jnml LEMS_example-izhikevich2007network-sim.xml -graph
 jNeuroML v0.10.1
(INFO) Reading from: /home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-Documentation/source/Userdocs/NML2_examples/LEMS_example-izhikevich2007network-sim.xml
(INFO) simCpt: Component(id=example-izhikevich2007network-sim type=Simulation)
Writing to: /home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-Documentation/source/Userdocs/NML2_examples/LEMS_example-izhikevich2007network-sim.gv
----Error: /home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-Documentation/source/Userdocs/NML2_examples/LEMS_example-izhikevich2007network-sim.gv: syntax error in line 3 near '-'
Have successfully run command: dot -Tpng  /home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-Documentation/source/Userdocs/NML2_examples/LEMS_example-izhikevich2007network-sim.gv -o /home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-Documentation/source/Userdocs/NML2_examples/LEMS_example-izhikevich2007network-sim.png

we now get this:

jnml LEMS_example-izhikevich2007network-sim.xml -graph
 jNeuroML v0.10.1
(INFO) Reading from: /home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-Documentation/source/Userdocs/NML2_examples/LEMS_example-izhikevich2007network-sim.xml
(INFO) simCpt: Component(id=example-izhikevich2007network-sim type=Simulation)
Writing to: /home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-Documentation/source/Userdocs/NML2_examples/LEMS_example-izhikevich2007network-sim.gv
----Error: /home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-Documentation/source/Userdocs/NML2_examples/LEMS_example-izhikevich2007network-sim.gv: syntax error in line 3 near '-'
Error running command: dot -Tpng  /home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-Documentation/source/Userdocs/NML2_examples/LEMS_example-izhikevich2007network-sim.gv -o /home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-Documentation/source/Userdocs/NML2_examples/LEMS_example-izhikevich2007network-sim.png

We now check the error code returned by the command before printing
"successfully ran..". If there's an error in the command, because of a
malformed dot file for example, we will print the stderr messages for
the user and clearly state that the command failed.
@sanjayankur31 sanjayankur31 added the T: Enhancement Type: enhancement label Feb 3, 2021
@pgleeson pgleeson merged commit 3326be0 into development Feb 15, 2021
@pgleeson
Copy link
Member

Looks good!

@sanjayankur31 sanjayankur31 deleted the enh/check-graphviz-error-code branch February 15, 2021 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T: Enhancement Type: enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants