Verified Commit f227a041 authored by Amin Bandali's avatar Amin Bandali
Browse files

Write out FileResult even when the parser throws

we were exitting early and thus not serializing FileResult
parent 496087d0
......@@ -145,6 +145,7 @@ public final class SSR extends CatalystCommand implements Runnable {
fr.errors = new ArrayList<ParseOrTypeError>();
String progress = String.format("[%d/%d]: ", index, total);
String finalStatus = "done";
Path prefix = Paths.get(outDir, corpus);
Path fName;
......@@ -180,18 +181,17 @@ public final class SSR extends CatalystCommand implements Runnable {
CompModule world;
try {
world = CompUtil.parseEverything_fromFile(rep, null, fr.file_name);
fr.ssr_result = detectRemovableSigs(world);
} catch (Err e) {
String
msg = "Error in parsing or type checking. Stack trace from the exception:",
err = Utils.toString(e);
pln(progress + "error: " + fr.file_name);
fr.errors.add(new ParseOrTypeError(String.format("%s%n%s", msg, err), true));
errorCount.getAndIncrement();
return fr;
finalStatus = "error";
}
fr.ssr_result = detectRemovableSigs(world);
pln(progress + "done: " + fr.file_name);
pln(progress + finalStatus + ": " + fr.file_name);
try {
w.write(gson.toJson(fr));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment