summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpidd.cpp
diff options
context:
space:
mode:
authorAidan Skinner <aidan@apache.org>2009-10-11 23:22:08 +0000
committerAidan Skinner <aidan@apache.org>2009-10-11 23:22:08 +0000
commit98cc985dbd81a84cd0b0a969c57cb941680ec81f (patch)
treea9060c1f208897cbd9dd4791b29202c78566993b /qpid/cpp/src/qpidd.cpp
parent788f96fd8af146cba5bff57300b1a513988c34b9 (diff)
downloadqpid-python-98cc985dbd81a84cd0b0a969c57cb941680ec81f.tar.gz
Merge from trunk
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/java-network-refactor@824198 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpidd.cpp')
-rw-r--r--qpid/cpp/src/qpidd.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/qpid/cpp/src/qpidd.cpp b/qpid/cpp/src/qpidd.cpp
index 1839a62205..f2b46942fb 100644
--- a/qpid/cpp/src/qpidd.cpp
+++ b/qpid/cpp/src/qpidd.cpp
@@ -36,25 +36,29 @@ int main(int argc, char* argv[])
{
try
{
- {
- BootstrapOptions bootOptions(argv[0]);
- string defaultPath (bootOptions.module.loadDir);
- // Parse only the common, load, and log options to see which
- // modules need to be loaded. Once the modules are loaded,
- // the command line will be re-parsed with all of the
- // module-supplied options.
+ BootstrapOptions bootOptions(argv[0]);
+ string defaultPath (bootOptions.module.loadDir);
+ // Parse only the common, load, and log options to see which
+ // modules need to be loaded. Once the modules are loaded,
+ // the command line will be re-parsed with all of the
+ // module-supplied options.
+ try {
bootOptions.parse (argc, argv, bootOptions.common.config, true);
qpid::log::Logger::instance().configure(bootOptions.log);
+ } catch (const std::exception& e) {
+ // Couldn't configure logging so write the message direct to stderr.
+ cerr << "Unexpected error: " << e.what() << endl;
+ return 1;
+ }
- for (vector<string>::iterator iter = bootOptions.module.load.begin();
- iter != bootOptions.module.load.end();
- iter++)
- qpid::tryShlib (iter->data(), false);
+ for (vector<string>::iterator iter = bootOptions.module.load.begin();
+ iter != bootOptions.module.load.end();
+ iter++)
+ qpid::tryShlib (iter->data(), false);
- if (!bootOptions.module.noLoad) {
- bool isDefault = defaultPath == bootOptions.module.loadDir;
- qpid::loadModuleDir (bootOptions.module.loadDir, isDefault);
- }
+ if (!bootOptions.module.noLoad) {
+ bool isDefault = defaultPath == bootOptions.module.loadDir;
+ qpid::loadModuleDir (bootOptions.module.loadDir, isDefault);
}
// Parse options