in src/main/java/org/apache/commons/exec/DefaultExecutor.java [299:317]
public void execute(final CommandLine command, final Map<String, String> environment, final ExecuteResultHandler handler)
throws ExecuteException, IOException {
checkWorkingDirectory();
if (watchdog != null) {
watchdog.setProcessNotStarted();
}
executorThread = createThread(() -> {
int exitValue = INVALID_EXITVALUE;
try {
exitValue = executeInternal(command, environment, workingDirectory, executeStreamHandler);
handler.onProcessComplete(exitValue);
} catch (final ExecuteException e) {
handler.onProcessFailed(e);
} catch (final Exception e) {
handler.onProcessFailed(new ExecuteException("Execution failed", exitValue, e));
}
}, "CommonsExecDefaultExecutor");
getExecutorThread().start();
}