Skip to content

Commit

Permalink
Update the error info when Docker Compose hasn't been installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
diqiu50 committed Apr 7, 2024
1 parent 8f08d30 commit a142226
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ public class TrinoITContainers implements AutoCloseable {
}

public void launch(int gravitinoServerPort) throws Exception {
Object error =
CommandExecutor.executeCommandLocalHost(
"docker compose version", false, ProcessData.TypesOfData.ERROR);
if (Strings.isNotEmpty(error.toString())) {
String message = "Check docker compose failed:" + error;
LOG.error(message);
throw new ContainerLaunchException(message);
}

shutdown();

Map<String, String> env = new HashMap<>();
Expand Down Expand Up @@ -67,7 +76,8 @@ private void resolveServerAddress() throws Exception {

String containerIpMapping = output.toString();
if (containerIpMapping.isEmpty()) {
throw new ContainerLaunchException("Missing to get container status");
throw new ContainerLaunchException(
"Failed to get the container status; the containers have not started");
}

try {
Expand Down

0 comments on commit a142226

Please sign in to comment.