summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/Parser.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2002-07-24 18:23:23 +0000
committerBenoit Foucher <benoit@zeroc.com>2002-07-24 18:23:23 +0000
commit6de52073a907e0d35657cc66b0214ba17ed19f62 (patch)
treebc81b1b5c9477a1dfb4634b4a0406a223eb2ae24 /cpp/src/IcePack/Parser.cpp
parentuse ICE_HOME to find slice files (diff)
downloadice-6de52073a907e0d35657cc66b0214ba17ed19f62.tar.bz2
ice-6de52073a907e0d35657cc66b0214ba17ed19f62.tar.xz
ice-6de52073a907e0d35657cc66b0214ba17ed19f62.zip
Much improved error handling and reporting.
Diffstat (limited to 'cpp/src/IcePack/Parser.cpp')
-rw-r--r--cpp/src/IcePack/Parser.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/cpp/src/IcePack/Parser.cpp b/cpp/src/IcePack/Parser.cpp
index 8c37e45ac4b..245bb940d0c 100644
--- a/cpp/src/IcePack/Parser.cpp
+++ b/cpp/src/IcePack/Parser.cpp
@@ -61,9 +61,9 @@ void
IcePack::Parser::addServer(const list<string>& args, const std::list<std::string>& adapters,
const std::list<std::string>& options)
{
- if(args.size() < 2)
+ if(args.size() != 4)
{
- error("`server add' requires at least two arguments (type `help' for more info)");
+ error("`server add' requires four arguments (type `help' for more info)");
return;
}
@@ -77,7 +77,18 @@ IcePack::Parser::addServer(const list<string>& args, const std::list<std::string
string descriptor = *p++;
_admin->addServer(name, path, ldpath, descriptor);
-
+ }
+ catch(const ParserDeploymentException& ex)
+ {
+ ostringstream s;
+ s << ex << ": " << ex.component << ": " << ex.reason;
+ error(s.str());
+ }
+ catch(const DeploymentException& ex)
+ {
+ ostringstream s;
+ s << ex << ": " << ex.component << ": " << ex.reason;
+ error(s.str());
}
catch(const Exception& ex)
{