Skip to content

Instantly share code, notes, and snippets.

@xeolabs
Created September 24, 2009 23:59
Show Gist options
  • Save xeolabs/193152 to your computer and use it in GitHub Desktop.
Save xeolabs/193152 to your computer and use it in GitHub Desktop.
private static void runJsUnitInRhino(String entryPoint) {
//...
int result = proc.waitFor();
if (result != 0) {
throw new JSExecutionException(getStdError(proc));
}
}
private static String getStdError(Process proc) throws IOException {
StringBuilder sb = new StringBuilder();
final BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
String lineResult = null;
while ((lineResult = reader.readLine()) != null) {
sb.append(lineResult);
}
return sb.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment