mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs] Log executable validation failure reason
This commit is contained in:
@@ -90,9 +90,22 @@ public abstract class ExecutableValidator {
|
||||
commandLine.setExePath(executable);
|
||||
CapturingProcessHandler handler = new CapturingProcessHandler(commandLine.createProcess(), CharsetToolkit.getDefaultSystemCharset());
|
||||
ProcessOutput result = handler.runProcess(60 * 1000);
|
||||
return !result.isTimeout() && (result.getExitCode() == 0) && result.getStderr().isEmpty();
|
||||
boolean timeout = result.isTimeout();
|
||||
int exitCode = result.getExitCode();
|
||||
String stderr = result.getStderr();
|
||||
if (timeout) {
|
||||
LOG.warn("Validation of " + executable + " failed with a timeout");
|
||||
}
|
||||
if (exitCode != 0) {
|
||||
LOG.warn("Validation of " + executable + " failed with non-zero exit code: " + exitCode);
|
||||
}
|
||||
if (!stderr.isEmpty()) {
|
||||
LOG.warn("Validation of " + executable + " failed with a non-empty error output: " + stderr);
|
||||
}
|
||||
return !timeout && exitCode == 0 && stderr.isEmpty();
|
||||
}
|
||||
catch (Throwable ignored) {
|
||||
catch (Throwable t) {
|
||||
LOG.warn(t);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user