Skip to content

Commit

Permalink
When reporting REPORT_PATH_IO_ERROR, indicate what the actual error was.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141131413
  • Loading branch information
tbreisacher authored and blickly committed Dec 6, 2016
1 parent 72cd039 commit 24d4f1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/google/javascript/jscomp/NameAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ final class NameAnalyzer implements CompilerPass {

static final DiagnosticType REPORT_PATH_IO_ERROR =
DiagnosticType.error("JSC_REPORT_PATH_IO_ERROR",
"Error writing compiler report to {0}");
"Error writing compiler report to {0}:\n{1}");

/**
* All the aliases in a program form a graph, where each global name is
Expand Down Expand Up @@ -1132,7 +1132,7 @@ static void createEmptyReport(AbstractCompiler compiler, String reportPath) {
try {
Files.write("", new File(reportPath), UTF_8);
} catch (IOException e) {
compiler.report(JSError.make(REPORT_PATH_IO_ERROR, reportPath));
compiler.report(JSError.make(REPORT_PATH_IO_ERROR, reportPath, e.getMessage()));
}
}

Expand All @@ -1158,7 +1158,7 @@ public void process(Node externs, Node root) {
try {
Files.append(getHtmlReport(), new File(reportPath), UTF_8);
} catch (IOException e) {
compiler.report(JSError.make(REPORT_PATH_IO_ERROR, reportPath));
compiler.report(JSError.make(REPORT_PATH_IO_ERROR, reportPath, e.getMessage()));
}
}

Expand Down

0 comments on commit 24d4f1a

Please sign in to comment.