summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/phonebook/Parser.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-09-25 23:29:39 +0000
committerMarc Laukien <marc@zeroc.com>2001-09-25 23:29:39 +0000
commit9a5b8decaffd5b7276d571d2d1cf7dc527c9cd3d (patch)
tree919b333472a90ca5977e3c2786ad32a834e1fc5c /cpp/demo/Freeze/phonebook/Parser.cpp
parentfixes (diff)
downloadice-9a5b8decaffd5b7276d571d2d1cf7dc527c9cd3d.tar.bz2
ice-9a5b8decaffd5b7276d571d2d1cf7dc527c9cd3d.tar.xz
ice-9a5b8decaffd5b7276d571d2d1cf7dc527c9cd3d.zip
many, many freeze and other fixes
Diffstat (limited to 'cpp/demo/Freeze/phonebook/Parser.cpp')
-rw-r--r--cpp/demo/Freeze/phonebook/Parser.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/cpp/demo/Freeze/phonebook/Parser.cpp b/cpp/demo/Freeze/phonebook/Parser.cpp
index 9b3d262b1ac..79b7480913b 100644
--- a/cpp/demo/Freeze/phonebook/Parser.cpp
+++ b/cpp/demo/Freeze/phonebook/Parser.cpp
@@ -18,6 +18,7 @@
using namespace std;
using namespace Ice;
+using namespace Freeze;
extern FILE* yyin;
@@ -38,7 +39,6 @@ Parser::usage()
"address ADDRESS Set the address for the current contact to ADDRESS.\n"
"phone PHONE Set the phone number for the current contact to PHONE.\n"
"remove Permanently remove the current contact from the phonebook.\n"
- "list List all names in the phonebook.\n"
"shutdown Shut the phonebook server down.\n";
}
@@ -66,6 +66,10 @@ Parser::addContacts(const std::list<std::string>& args)
cout << "added new contact for `" << *p << "'" << endl;
}
}
+ catch(const DBExceptionPtrE& ex)
+ {
+ error(ex->message);
+ }
catch(const LocalException& ex)
{
error(ex.toString());
@@ -88,6 +92,10 @@ Parser::findContacts(const std::list<std::string>& args)
cout << "number of contacts found: " << _foundContacts.size() << endl;
printCurrent();
}
+ catch(const DBExceptionPtrE& ex)
+ {
+ error(ex->message);
+ }
catch(const LocalException& ex)
{
error(ex.toString());
@@ -121,6 +129,10 @@ Parser::printCurrent()
cout << "no current contact" << endl;
}
}
+ catch(const DBExceptionPtrE& ex)
+ {
+ error(ex->message);
+ }
catch(const LocalException& ex)
{
error(ex.toString());
@@ -148,6 +160,10 @@ Parser::setCurrentName(const std::list<std::string>& args)
cout << "no current contact" << endl;
}
}
+ catch(const DBExceptionPtrE& ex)
+ {
+ error(ex->message);
+ }
catch(const LocalException& ex)
{
error(ex.toString());
@@ -175,6 +191,10 @@ Parser::setCurrentAddress(const std::list<std::string>& args)
cout << "no current contact" << endl;
}
}
+ catch(const DBExceptionPtrE& ex)
+ {
+ error(ex->message);
+ }
catch(const LocalException& ex)
{
error(ex.toString());
@@ -202,6 +222,10 @@ Parser::setCurrentPhone(const std::list<std::string>& args)
cout << "no current contact" << endl;
}
}
+ catch(const DBExceptionPtrE& ex)
+ {
+ error(ex->message);
+ }
catch(const LocalException& ex)
{
error(ex.toString());
@@ -223,6 +247,10 @@ Parser::removeCurrent()
cout << "no current contact" << endl;
}
}
+ catch(const DBExceptionPtrE& ex)
+ {
+ error(ex->message);
+ }
catch(const LocalException& ex)
{
error(ex.toString());
@@ -236,6 +264,10 @@ Parser::shutdown()
{
_phoneBook->shutdown();
}
+ catch(const DBExceptionPtrE& ex)
+ {
+ error(ex->message);
+ }
catch(const LocalException& ex)
{
error(ex.toString());