sandbox: Clean up comments / code in SandboxRunner#run.
MOS_MIGRATED_REVID=151160662
@@ -85,24 +85,28 @@ abstract class SandboxRunner {
status = ((AbnormalTerminationException) e).getResult().getTerminationStatus();
timedOut = !status.exited() && (status.getTerminatingSignal() == getSignalOnTimeout());
}
+
String statusMessage = status + " [sandboxed]";
+
if (!verboseFailures) {
- // simplest error message
+ // Simplest possible error message.
throw new UserExecException(statusMessage, e, timedOut);
}
- List<String> commandList;
- if (!sandboxDebug) {
- commandList = arguments;
- } else {
+
+ List<String> commandList = arguments;
+ if (sandboxDebug) {
+ // When using --sandbox_debug, show the entire command-line including the part where we call
+ // the sandbox helper binary.
commandList = Arrays.asList(cmd.getCommandLineElements());
}
+
String commandFailureMessage =
- CommandFailureUtils.describeCommandFailure(
- true,
- commandList,
- environment,
- null)
- + (sandboxDebug ? "" : SANDBOX_DEBUG_SUGGESTION);
+ CommandFailureUtils.describeCommandFailure(true, commandList, environment, null);
+
+ if (!sandboxDebug) {
+ commandFailureMessage += SANDBOX_DEBUG_SUGGESTION;
+ }
+
throw new UserExecException(commandFailureMessage, e, timedOut);
}
}
