Comments 7 Posted In Red Hat JBoss Enterprise Application Platform JBoss Enterprise Web Platform Tags jboss_eap jboss-cli --file exit on error Latest response 2015-07-13T15:00:33+00:00 why is the jboss-cli stopped after an error in the cli script? Is it possible to ignore errors? AG Started 2014-01-03T14:32:00+00:00 by Arjan Goos Newbie 15 points Log in to join the conversation Responses Sort By Oldest Sort By Newest PD Newbie 7 points 11 September 2014 5:37 PM Paulo Henrique Duarte +1 Red Hat Guru 25369 points 16 September 2014 3:31 PM David Powles Hi Paulo, This issue was originally posted back in February, but as you seem to have encountered it more recently, could you provide some more information as Russell requested in his comment below? RD Red Hat Guru 1316 points 15 September 2014 12:22 AM Russell Dickenson Arjan - Can you explain a little more, or give an example, of what you are trying to achieve? If an error occurs while processing a CLI script, I would think it makes sense for processing to stop. If an error occurred, yet that error was ignored, the result may be that the changes you intended didn't take place, or in a worst-case scenario, unwanted changes occurred instead. AA Newbie 10 points 9 July 2015 1:37 PM Akhmad Amirov Russell There are some cases when it would be useful to continue the processing. For example, I have a script that configure multiple host controllers. But for different environments or JBoss farms there are different number of servers. And If I want too use a template and not a custom script for every JBoss farm. So, If there is a "if" condition, for example, to continue if failed or stop it would solve many cases working with CLI and trying to minimize manual configuration changes. rh Red Hat Pro 697 points 13 July 2015 1:27 PM rhn-support-tfonteyne It sounds like you're asking for the equivalent of "on error continue" (or "on error goto") which is really a bad idea. You will be much better of when you script this properly using a JDK supported scripting language. This will offer all the control you might need. Please take a look at the examples: https://developer.jboss.org/wiki/AdvancedCLIScriptingWithGroovyRhinoJythonEtc AA Newbie 10 points 13 July 2015 2:50 PM Akhmad Amirov I do not think it is a bad idea to have "on error continue". It should be up to a admin how to proceed with the result. I am against "goto", but ability to stop or continue the script run gives a flexibility to the simplicity of CLI approach. Groovy or JS is fine but I do not want to go to the development process when I just need to configure AS. Also, having something is not necessary to be used. But can be used if necessary. :) Red Hat Guru 1808 points 13 July 2015 3:00 PM Mustafa Musaji So to answer your question then it's not possible to ignore errors (they are errors and should not be ignored) as Tom and Russell mentioned. Especially in a script - you want to know if anything failed during set up believe me and not blindly ignore it. If you want to you can create proper logic on errors using the JDK supported scripting language which is what is supported and enables you to add logic that a script just can't do as easily or as well.