Kaydet (Commit) 52b23b98 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Print message of uncaught UNO exceptions

Change-Id: I6a716efe28086da983a40c550613e3d8e0bd8283
üst f0c5abd1
......@@ -17,7 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "sal/config.h"
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stack>
......@@ -296,8 +299,7 @@ public:
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
try {
if( argc < 4) {
printf( "usage : %s <locaLe> <XML inputfile> <destination file>\n", argv[0] );
exit( 1 );
......@@ -327,21 +329,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
source.aInputStream = createStreamFromFile( argv[2] );
source.sSystemId = OUString::createFromAscii( argv[2] );
try
{
// start parsing
rParser->parseStream( source );
}
catch( const Exception & e )
{
OString o1 = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8 );
printf( "Exception during parsing : %s\n" , o1.getStr() );
exit(1);
}
nError = pDocHandler->nError;
return nError;
} catch (css::uno::Exception & e) {
std::cerr << "ERROR: " << e.Message << '\n';
return EXIT_FAILURE;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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