Skip to content
Permalink
Browse files

Merge pull request #96 from jp-embedded/issue_93

provide meaningful error on missing event
  • Loading branch information...
jp-embedded committed Mar 29, 2019
2 parents b626f81 + 5ebe4e2 commit da8ca805a12c52d525147e93cbaa67da9e61c3d6
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/scxml_parser.cpp
@@ -283,12 +283,17 @@ boost::shared_ptr<scxml_parser::action> scxml_parser::parse_raise(const ptree &p
boost::shared_ptr<action> ac = boost::make_shared<action>();
try {
const ptree &xmlattr = pt.get_child("<xmlattr>");

const string event = xmlattr.get<string>("event");

ac->type = "raise";
ac->attr["event"] = event;
}
catch (ptree_error &e) {
cerr << "error: '<raise>' must contain an 'event' attribute." << endl;
exit(1);
}

try {
for (ptree::const_iterator it = pt.begin(); it != pt.end(); ++it) {
if (it->first == "<xmlcomment>") ; // ignore comments
else if (it->first == "<xmlattr>") ; // ignore, parsed above

0 comments on commit da8ca80

Please sign in to comment.
You can’t perform that action at this time.