Kaydet (Commit) 3dbcd85b authored tarafından Herbert Dürr's avatar Herbert Dürr

saxparser: failure inducing exceptions are message worthy

üst 8f11dce7
...@@ -321,8 +321,6 @@ public: ...@@ -321,8 +321,6 @@ public:
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{ {
if( argc < 6) { if( argc < 6) {
printf( "usage : %s <locaLe> <XML inputfile> <destination file> <services.rdb location> <types.rdb location>\n", argv[0] ); printf( "usage : %s <locaLe> <XML inputfile> <destination file> <services.rdb location> <types.rdb location>\n", argv[0] );
exit( 1 ); exit( 1 );
...@@ -336,9 +334,10 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) ...@@ -336,9 +334,10 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
::rtl::OUString::createFromAscii(argv[4]), ::rtl::OUString::createFromAscii(argv[4]),
::rtl::OUString::createFromAscii(argv[5]), true ); ::rtl::OUString::createFromAscii(argv[5]), true );
} }
catch ( Exception& ) catch( const Exception& e)
{ {
printf( "Exception on createRegistryServiceFactory\n" ); const OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8 );
printf( "Exception on createRegistryServiceFactory: \"%s\"\n", aMsg.getStr() );
exit(1); exit(1);
} }
...@@ -373,10 +372,10 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) ...@@ -373,10 +372,10 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
rParser->parseStream( source ); rParser->parseStream( source );
} }
catch( Exception & e ) catch( const Exception& e)
{ {
OString o1 = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8 ); const OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8 );
printf( "Exception during parsing : %s\n" , o1.getStr() ); printf( "Exception during parsing : \"%s\"\n", aMsg.getStr() );
exit(1); exit(1);
} }
nError = pDocHandler->nError; nError = pDocHandler->nError;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment