diff --git a/tests/datarule.cpp b/tests/datarule.cpp
index 83d2b480401f7f59292482f24fd06e244fc03fc9..ac00881fda8ef570ac03ee2df7429b5c80723aef 100644
--- a/tests/datarule.cpp
+++ b/tests/datarule.cpp
@@ -1,5 +1,7 @@
 #include "datadriven.h"
 
+#include <antlr/RecognitionException.hpp>
+
 #include <libpwrutils/util.h>
 #include <libpwrutils/foreach.h>
 #include <libpwrutils/pathsearch.h>
@@ -199,6 +201,13 @@ void test_one_rule_item(const rule_compare_test& c)
 		test_one_rule_item_actual(c);
 	} catch (PwrNlp::PwrNlpError& e) {
 		BOOST_ERROR("Caught " << e.scope() << " exception: \n" << e.info());
+	} catch (antlr::RecognitionException &e) {
+		BOOST_ERROR("Caught " << "ANTLR" << " exception: \n"
+			<< e.getFileLineColumnString()
+			<< " " << e.getMessage());
+	} catch (antlr::ANTLRException &e) {
+		BOOST_ERROR("Caught " << "ANTLR" << " exception: \n"
+			<< " " << e.getMessage());
 	}
 }