File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939
4040public final class Main {
4141
42- private static final int THREADS_SHUTDOWN_EXIT_CODE = -1 ;
4342 public static final File LOG_DIRECTORY = new File ("logs" );
4443 public static volatile AtomicLong nrQueries = new AtomicLong ();
4544 public static volatile AtomicLong nrDatabases = new AtomicLong ();
@@ -305,7 +304,7 @@ public static int executeMain(String[] args) throws AssertionError {
305304 jc .parse (args );
306305 if (jc .getParsedCommand () == null ) {
307306 jc .usage ();
308- return THREADS_SHUTDOWN_EXIT_CODE ;
307+ return options . getErrorExitCode () ;
309308 }
310309
311310 if (options .printProgressInformation ()) {
@@ -407,7 +406,7 @@ private void runThread(final String databaseName) {
407406 e .printStackTrace ();
408407 }
409408 }
410- return threadsShutdown == 0 ? 0 : THREADS_SHUTDOWN_EXIT_CODE ;
409+ return threadsShutdown == 0 ? 0 : options . getErrorExitCode () ;
411410 }
412411
413412 private static void startProgressMonitor () {
Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ public class MainOptions {
4444 @ Parameter (names = "--timeout-seconds" , description = "The timeout in seconds" )
4545 private int timeoutSeconds = -1 ;
4646
47+ @ Parameter (names = "--exit-code-error" , description = "The exit code that should be returned when an error is encountered (or a bug is found)" )
48+ private int errorExitCode = -1 ;
49+
4750 public int getMaxExpressionDepth () {
4851 return maxExpressionDepth ;
4952 }
@@ -103,4 +106,8 @@ public int getTimeoutSeconds() {
103106 return timeoutSeconds ;
104107 }
105108
109+ public int getErrorExitCode () {
110+ return errorExitCode ;
111+ }
112+
106113}
You can’t perform that action at this time.
0 commit comments