diff options
author | Rüdiger Timm <rt@openoffice.org> | 2003-04-17 08:40:17 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2003-04-17 08:40:17 +0000 |
commit | 9476a7355262fa184a8138d5eb6d6b80b0c15191 (patch) | |
tree | 9c760c8768d12a767c94730422e2c0a1a814c3ae /odk/examples/cpp | |
parent | 1963339633d31239255c3d3fbefee4b09a8a9cd5 (diff) |
INTEGRATION: CWS sdk01 (1.3.20.1.6); FILE MERGED
2003/03/13 11:39:21 jsc 1.3.20.1.6.1: #107908# catch exception
Diffstat (limited to 'odk/examples/cpp')
-rw-r--r-- | odk/examples/cpp/DocumentLoader/DocumentLoader.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx b/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx index b74028180a4c..fc1c0d0d8dbe 100644 --- a/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx +++ b/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx @@ -102,8 +102,18 @@ int SAL_CALL main( int argc, char **argv ) Reference< XUnoUrlResolver > resolver( xInterface, UNO_QUERY ); // Resolves the component context from the office, on the uno URL given by argv[1]. - xInterface = Reference< XInterface >( - resolver->resolve( sConnectionString ), UNO_QUERY ); + try + { + xInterface = Reference< XInterface >( + resolver->resolve( sConnectionString ), UNO_QUERY ); + } + catch ( Exception& e ) + { + printf("Error: cannot establish a connection using '%s':\n %s\n", + OUStringToOString(sConnectionString, RTL_TEXTENCODING_ASCII_US).getStr(), + OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr()); + exit(1); + } // gets the server component context as property of the office component factory Reference< XPropertySet > xPropSet( xInterface, UNO_QUERY ); |