示例#1
0
 /**
  * Checks whether the execution result return value is 0. If not, throws an exception.
  *
  * @param executionResult the process execution result
  * @throws Exception if exit value is different than 0
  */
 public static void checkReturnValue(ExecutionResult executionResult) throws Exception {
   int exitValue = executionResult.getReturnValue();
   if (exitValue != ExecutionResult.OK) {
     throw new Exception(
         "Exit value: "
             + exitValue
             + ", StdErr: "
             + executionResult.getStdErr().toString()
             + ", StdOut: "
             + executionResult.getStdOut().toString());
   }
 }