code: public static void runCommand(String[] cmdArray, File logFile, File dir) {
          Process proc = System.runProcess(cmdArray, logFile, dir);
          if (proc.exitValue() != 0) {
              throw new RuntimeException("Command failed with exit code " + proc.exitValue() + ": "
                      + System.cmdToString(cmdArray) + "\n" + QFiles.tail(logFile));
          }
      }
docs: Checks the exit code and throws an Exception if the process failed.