From: tho Date: Wed, 6 Jan 2010 15:44:47 +0000 (+0000) Subject: Console: fixed exception handling in Executor::getNode() X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=b0918b010bd5ebfb4cce6900c6889dbe4767b5f3;p=senf.git Console: fixed exception handling in Executor::getNode() git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1540 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Utils/Console/Executor.cc b/senf/Utils/Console/Executor.cc index d93fab2..ce2376f 100644 --- a/senf/Utils/Console/Executor.cc +++ b/senf/Utils/Console/Executor.cc @@ -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,