diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-01 14:42:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-07 07:12:39 +0100 |
commit | 8b5e23eac31cafbd442a3acab5fbcf98bfd0af11 (patch) | |
tree | d41feeea533127280e0503d0dc2dd55a4ab83ce8 /io | |
parent | 4f810905fa74128871f2fe924a3d28a79f4e4261 (diff) |
log nice exception messages whereever possible
Change-Id: Idd125c18bee1a39b9ea8cc4f8c55cddfd37c33e1
Reviewed-on: https://gerrit.libreoffice.org/68579
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'io')
-rw-r--r-- | io/Library_io.mk | 1 | ||||
-rw-r--r-- | io/source/stm/opump.cxx | 27 |
2 files changed, 17 insertions, 11 deletions
diff --git a/io/Library_io.mk b/io/Library_io.mk index c203daae2e78..8f85ca8b42a8 100644 --- a/io/Library_io.mk +++ b/io/Library_io.mk @@ -17,6 +17,7 @@ $(eval $(call gb_Library_use_libraries,io,\ cppu \ cppuhelper \ sal \ + tl \ )) $(eval $(call gb_Library_set_componentfile,io,io/source/io)) diff --git a/io/source/stm/opump.cxx b/io/source/stm/opump.cxx index 0bcccef819ae..e1b4fe043d5c 100644 --- a/io/source/stm/opump.cxx +++ b/io/source/stm/opump.cxx @@ -41,7 +41,7 @@ #include <cppuhelper/supportsservice.hxx> #include <osl/mutex.hxx> #include <osl/thread.h> - +#include <tools/diagnose_ex.h> using namespace osl; using namespace std; @@ -132,9 +132,10 @@ void Pump::fireError( const Any & exception ) { static_cast< XStreamListener * > ( iter.next() )->error( exception ); } - catch ( const RuntimeException &e ) + catch ( const RuntimeException & ) { - SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << exceptionToString(ex)); } } } @@ -160,9 +161,10 @@ void Pump::fireClose() { static_cast< XStreamListener * > ( iter.next() )->closed( ); } - catch ( const RuntimeException &e ) + catch ( const RuntimeException & ) { - SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << exceptionToString(ex)); } } } @@ -177,9 +179,10 @@ void Pump::fireStarted() { static_cast< XStreamListener * > ( iter.next() )->started( ); } - catch ( const RuntimeException &e ) + catch ( const RuntimeException & ) { - SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << exceptionToString(ex)); } } } @@ -193,9 +196,10 @@ void Pump::fireTerminated() { static_cast< XStreamListener * > ( iter.next() )->terminated(); } - catch ( const RuntimeException &e ) + catch ( const RuntimeException & ) { - SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << exceptionToString(ex)); } } } @@ -293,11 +297,12 @@ void Pump::run() close(); fireClose(); } - catch ( const css::uno::Exception &e ) + catch ( const css::uno::Exception & ) { // we are the last on the stack. // this is to avoid crashing the program, when e.g. a bridge crashes - SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << exceptionToString(ex)); } } |