aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project/SparkBuild.scala9
1 files changed, 6 insertions, 3 deletions
diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index 550b5bad8a..6eba58c87c 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -433,9 +433,12 @@ object Catalyst {
}
// Generate the parser.
- antlr.process
- if (antlr.getNumErrors > 0) {
- log.error("ANTLR: Caught %d build errors.".format(antlr.getNumErrors))
+ antlr.process()
+ val errorState = org.antlr.tool.ErrorManager.getErrorState
+ if (errorState.errors > 0) {
+ sys.error("ANTLR: Caught %d build errors.".format(errorState.errors))
+ } else if (errorState.warnings > 0) {
+ sys.error("ANTLR: Caught %d build warnings.".format(errorState.warnings))
}
// Return all generated java files.