diff options
author | Josh Blum | 2013-03-22 00:45:04 -0700 |
---|---|---|
committer | Josh Blum | 2013-03-22 00:45:04 -0700 |
commit | a54708334425472d277e77c394688bab4cac607a (patch) | |
tree | 9ab28fae5f1d4b964da6cdfbbff1ae937e28b700 /lib/block_props.cpp | |
parent | 7efd7630b87c2ab1716ede4079b5840e730921db (diff) | |
download | sandhi-a54708334425472d277e77c394688bab4cac607a.tar.gz sandhi-a54708334425472d277e77c394688bab4cac607a.tar.bz2 sandhi-a54708334425472d277e77c394688bab4cac607a.zip |
gras: quick prop tree unit test + fixes
Diffstat (limited to 'lib/block_props.cpp')
-rw-r--r-- | lib/block_props.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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 |