sS extractAndPrintJavaParseError(S src, Throwable e) { new StringBuilder buf; print_tee(buf); S msg = takeFirstLines(2, innerMessage(e)); print_tee(buf, msg); int line = parseIntOpt(regexpFirstGroupIC("line (\\d+)", msg)); print_tee(buf); if (line != 0) { L lines = lines(src); for (int i = max(1, line-5); i <= min(l(lines), line+5); i++) print_tee(buf, (i == line ? "* " : " ") + "LINE " + i + ": " + lines.get(i-1)); } print_tee(buf); ret str(buf); }