Console: fixed exception handling in Executor::getNode()
tho [Wed, 6 Jan 2010 15:44:47 +0000 (15:44 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1540 270642c3-0616-0410-b53a-bc976706d245

senf/Utils/Console/Executor.cc

index d93fab2..ce2376f 100644 (file)
@@ -170,7 +170,15 @@ prefix_ void senf::console::Executor::execute(std::ostream & output,
 prefix_ senf::console::GenericNode &
 senf::console::Executor::getNode(ParseCommandInfo const & command)
 {
-    return traverseNode(command.commandPath());
+    try {
+        return traverseNode(command.commandPath());
+    }
+    catch (InvalidPathException & ex) {
+        throw SyntaxErrorException("invalid path") << " '" << ex.path << "'";
+    }
+    catch (InvalidDirectoryException & ex) {
+        throw SyntaxErrorException("invalid directory") << " '" << ex.path << "'";
+    }
 }
 
 prefix_ void senf::console::Executor::exec(std::ostream & output,