From a54708334425472d277e77c394688bab4cac607a Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 22 Mar 2013 00:45:04 -0700 Subject: gras: quick prop tree unit test + fixes --- lib/block_props.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/block_props.cpp') diff --git a/lib/block_props.cpp b/lib/block_props.cpp index 0f571af..ab8b642 100644 --- a/lib/block_props.cpp +++ b/lib/block_props.cpp @@ -92,6 +92,7 @@ static PMCC prop_access_dispatcher(ActorType &actor, const std::string &path, co if (node == "" and i == 1) //find root { while (elem->_parent) elem = elem->_parent; + continue; } if (node == ".") //this dir { @@ -109,9 +110,14 @@ static PMCC prop_access_dispatcher(ActorType &actor, const std::string &path, co { key = node; if (i != nodes.size() or not elem->block) throw std::runtime_error( - "Property tree lookup fail - beyond leaf" + path + "Property tree lookup fail - beyond leaf: " + path ); + continue; } + if (elem->_subelems.count(node) == 0) throw std::runtime_error( + "Property tree lookup fail - no such path: " + path + ); + elem = elem->_subelems[node]; } //now send a message to the actor to perform the action -- cgit