Skip to content
Snippets Groups Projects
Commit 3c3fe08f authored by ilor's avatar ilor
Browse files

handle ANTLR exceptions gracefully in rule data tests

parent ee569013
Branches
No related merge requests found
#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());
}
}
......
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