Skip to content

Commit

Permalink
Fix(inspect-code): getRetCode was always inverted
Browse files Browse the repository at this point in the history
  • Loading branch information
rkubis committed Nov 22, 2024
1 parent 311a580 commit 2b59596
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,21 +292,21 @@ public static ExecutionResultData executeAndCheck(String input, int timeout, Str
input
);

if (!results.getRetCode()) {
throw new IllegalStateException(results.getStdErr());
if (results.getRetCode()) {
return results;
}

return results;
throw new IllegalStateException(results.getStdErr());
}

public static ExecutionResultData executeAndCheck(
List<String> command, int timeout, boolean logToOutput, boolean appendLineSeparator, Map<String, String> env
) {
ExecutionResultData results = execute(command, timeout, logToOutput, appendLineSeparator, env, null);
if (!results.getRetCode()) {
throw new IllegalStateException(results.getStdErr());
if (results.getRetCode()) {
return results;
}
return results;
throw new IllegalStateException(results.getStdErr());
}

public static ExecutionResultData execute(List<String> command) {
Expand Down

0 comments on commit 2b59596

Please sign in to comment.