private ErrorHandler swallowingDownCommandDoesNotExist() { return (exitCode, output, commandName, commands) -> { if (downCommandWasPresent(output)) { Command.throwingOnError().handle(exitCode, output, commandName, commands); } log.warn("It looks like `docker-compose down` didn't work."); log.warn("This probably means your version of docker-compose doesn't support the `down` command"); log.warn("Updating to version 1.6+ of docker-compose is likely to fix this issue."); }; }
private static ErrorHandler swallowingDownCommandDoesNotExist() { return (exitCode, output, commandName, commands) -> { if (downCommandWasPresent(output)) { Command.throwingOnError().handle(exitCode, output, commandName, commands); } log.warn("It looks like `docker-compose down` didn't work."); log.warn("This probably means your version of docker-compose doesn't support the `down` command"); log.warn("Updating to version 1.6+ of docker-compose is likely to fix this issue."); }; }
private static ErrorHandler swallowingDownCommandDoesNotExist() { return (exitCode, output, commandName, commands) -> { if (downCommandWasPresent(output)) { Command.throwingOnError().handle(exitCode, output, commandName, commands); } log.warn("It looks like `docker-compose down` didn't work."); log.warn("This probably means your version of docker-compose doesn't support the `down` command"); log.warn("Updating to version 1.6+ of docker-compose is likely to fix this issue."); }; }
@Test public void invoke_error_handler_when_exit_code_of_the_executed_process_is_non_0() throws IOException, InterruptedException { int expectedExitCode = 1; givenTheUnderlyingProcessTerminatesWithAnExitCodeOf(expectedExitCode); dockerComposeCommand.execute(errorHandler, "rm", "-f"); verify(errorHandler).handle(expectedExitCode, "", "docker-compose", "rm", "-f"); }
public String execute(ErrorHandler errorHandler, String... commands) throws IOException, InterruptedException { ProcessResult result = run(commands); if (result.exitCode() != 0) { errorHandler.handle(result.exitCode(), result.output(), executable.commandName(), commands); } return result.output(); }
public String execute(ErrorHandler errorHandler, String... commands) throws IOException, InterruptedException { ProcessResult result = run(commands); if (result.exitCode() != 0) { errorHandler.handle(result.exitCode(), result.output(), executable.commandName(), commands); } return result.output(); }
public String execute(ErrorHandler errorHandler, String... commands) throws IOException, InterruptedException { ProcessResult result = run(commands); if (result.exitCode() != 0) { errorHandler.handle(result.exitCode(), result.output(), executable.commandName(), commands); } return result.output(); }