WIP: Console break on error in batch mode #1692
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Overall, this change alters the console behavior such that if an error occurs in batch mode or during a script, execution is halted and if in batch mode, the console is exited.
In particular these changes are introduced in
Console.java
:parse
method have 3 arguments (see line 731). The third argument is aboolean
indicating batch mode, which is true by default.parse
does not consume exeception anymore, but throws them upwards (see line 742ff).execute
method now throws alsoRuntimeExeception
(see line line 223)execute
method uses newparse
method depending on if batch mode is set.Motivation
Currently console continues to execute commands in scripts or batch even though previous command fails. This can produce unwanted results. Especially tracking errors is complicated since if the last line passes, it seems as if a script or batch is successful.
Additional Notes
@lvca
ConsoleTest
:testNotNullProperties
fails, is this test faulty?execute
.Checklist
mvn clean package
command