diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-15 10:44:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-19 09:39:48 +0100 |
commit | 183debd7e078d2daef38170afc8542a4e625602c (patch) | |
tree | af1f24b61933b2d9da2cc7bf9e8c95405c1f812c /slideshow | |
parent | 9c1383e4da135db28c422752153e9a77558e8c2f (diff) |
pretty up logging of exceptions
Add exceptionToString() and getCaughtExceptionAsString() methods in
tools.
Use the new methods in DbgUnhandledException()
Add special-case case code for most of the exceptions that contain extra
fields, so all of the relevant data ends up in the log
Change-Id: I376f6549b4d7bd480202f8bff17a454657c75ece
Reviewed-on: https://gerrit.libreoffice.org/67857
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/activitiesqueue.cxx | 5 | ||||
-rw-r--r-- | slideshow/source/engine/animationnodes/animationbasenode.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/eventqueue.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/pointersymbol.cxx | 3 | ||||
-rw-r--r-- | slideshow/source/engine/shapes/drawinglayeranimation.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/shapes/externalshapebase.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/shapes/viewbackgroundshape.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/shapes/viewmediashape.cxx | 4 | ||||
-rw-r--r-- | slideshow/source/engine/slide/layermanager.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/slide/slideanimations.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/slide/slideimpl.cxx | 6 | ||||
-rw-r--r-- | slideshow/source/engine/slidebitmap.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/slideshowimpl.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/soundplayer.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/waitsymbol.cxx | 3 | ||||
-rw-r--r-- | slideshow/test/demoshow.cxx | 2 |
16 files changed, 22 insertions, 21 deletions
diff --git a/slideshow/source/engine/activitiesqueue.cxx b/slideshow/source/engine/activitiesqueue.cxx index 484c04283236..3d1c076e2a02 100644 --- a/slideshow/source/engine/activitiesqueue.cxx +++ b/slideshow/source/engine/activitiesqueue.cxx @@ -18,8 +18,7 @@ */ -#include <comphelper/anytostring.hxx> -#include <cppuhelper/exc_hlp.hxx> +#include <tools/diagnose_ex.h> #include <osl/diagnose.h> #include <sal/log.hxx> @@ -119,7 +118,7 @@ namespace slideshow // since this will also capture segmentation // violations and the like. In such a case, we // still better let our clients now... - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString(cppu::getCaughtException()) ); } catch( SlideShowException& ) { diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx index c600be9830e6..107ac68650a6 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.cxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx @@ -208,7 +208,7 @@ bool AnimationBaseNode::init_st() mpActivity = createActivity(); } catch (uno::Exception const&) { - SAL_WARN( "slideshow", comphelper::anyToString(cppu::getCaughtException()) ); + SAL_WARN( "slideshow", exceptionToString(cppu::getCaughtException()) ); // catch and ignore. We later handle empty activities, but for // other nodes to function properly, the core functionality of // this node must remain up and running. diff --git a/slideshow/source/engine/eventqueue.cxx b/slideshow/source/engine/eventqueue.cxx index 33955faa61e4..5740a935264b 100644 --- a/slideshow/source/engine/eventqueue.cxx +++ b/slideshow/source/engine/eventqueue.cxx @@ -234,7 +234,7 @@ namespace slideshow // since this will also capture segmentation // violations and the like. In such a case, we // still better let our clients now... - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); } catch( SlideShowException& ) { diff --git a/slideshow/source/engine/pointersymbol.cxx b/slideshow/source/engine/pointersymbol.cxx index 7ba9a8b20c22..dbc7fed055d3 100644 --- a/slideshow/source/engine/pointersymbol.cxx +++ b/slideshow/source/engine/pointersymbol.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/rendering/XCanvas.hpp> #include <com/sun/star/presentation/XSlideShowView.hpp> +#include <tools/diagnose_ex.h> #include "pointersymbol.hxx" #include <eventmultiplexer.hxx> @@ -126,7 +127,7 @@ void PointerSymbol::viewAdded( const UnoViewSharedPtr& rView ) } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); } maViews.emplace_back( rView, sprite ); diff --git a/slideshow/source/engine/shapes/drawinglayeranimation.cxx b/slideshow/source/engine/shapes/drawinglayeranimation.cxx index 0ddbfc70b414..c8e21b5c8e15 100644 --- a/slideshow/source/engine/shapes/drawinglayeranimation.cxx +++ b/slideshow/source/engine/shapes/drawinglayeranimation.cxx @@ -935,7 +935,7 @@ std::shared_ptr<Activity> createDrawingLayerAnimActivity( catch( uno::Exception& ) { // translate any error into empty factory product. - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); } return pActivity; diff --git a/slideshow/source/engine/shapes/externalshapebase.cxx b/slideshow/source/engine/shapes/externalshapebase.cxx index fc7b00ead6d1..00ba2bb2c37b 100644 --- a/slideshow/source/engine/shapes/externalshapebase.cxx +++ b/slideshow/source/engine/shapes/externalshapebase.cxx @@ -108,7 +108,7 @@ namespace slideshow } catch (uno::Exception &) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); } } diff --git a/slideshow/source/engine/shapes/viewbackgroundshape.cxx b/slideshow/source/engine/shapes/viewbackgroundshape.cxx index e2fa6f3afc6b..a7cf3c26fd2f 100644 --- a/slideshow/source/engine/shapes/viewbackgroundshape.cxx +++ b/slideshow/source/engine/shapes/viewbackgroundshape.cxx @@ -185,7 +185,7 @@ namespace slideshow } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); return false; } diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index 71f4f727d7e8..6aecf9502d1c 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -321,7 +321,7 @@ namespace slideshow } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); } } } @@ -484,7 +484,7 @@ namespace slideshow } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); } } } diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx index 2fa5a139151e..84be4b5d6e2c 100644 --- a/slideshow/source/engine/slide/layermanager.cxx +++ b/slideshow/source/engine/slide/layermanager.cxx @@ -635,7 +635,7 @@ namespace slideshow { // TODO(E1): Might be superfluous. Nowadays, // addViewLayer swallows all errors, anyway. - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); // at least one shape could not be rendered bRet = false; } diff --git a/slideshow/source/engine/slide/slideanimations.cxx b/slideshow/source/engine/slide/slideanimations.cxx index 2264b4600f56..fca312a51802 100644 --- a/slideshow/source/engine/slide/slideanimations.cxx +++ b/slideshow/source/engine/slide/slideanimations.cxx @@ -56,7 +56,7 @@ namespace slideshow } catch (uno::Exception &) { - SAL_WARN( "slideshow", comphelper::anyToString(cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString(cppu::getCaughtException() ) ); } } diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 3d01f4dfbef4..4d74c69804fa 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -776,7 +776,7 @@ bool SlideImpl::implPrefetchShow() } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString(cppu::getCaughtException()) ); + SAL_WARN( "slideshow", exceptionToString(cppu::getCaughtException()) ); // TODO(E2): Error handling. For now, bail out } @@ -1026,7 +1026,7 @@ bool SlideImpl::loadShapes() } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); return false; } } @@ -1065,7 +1065,7 @@ bool SlideImpl::loadShapes() } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); return false; } diff --git a/slideshow/source/engine/slidebitmap.cxx b/slideshow/source/engine/slidebitmap.cxx index 4cf61b727678..4a92633924d6 100644 --- a/slideshow/source/engine/slidebitmap.cxx +++ b/slideshow/source/engine/slidebitmap.cxx @@ -85,7 +85,7 @@ namespace slideshow } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); return false; } diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 177ff07dfb1b..9865d7fa5776 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -2084,7 +2084,7 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout ) } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); } } diff --git a/slideshow/source/engine/soundplayer.cxx b/slideshow/source/engine/soundplayer.cxx index 505478cd3e33..65b578304d62 100644 --- a/slideshow/source/engine/soundplayer.cxx +++ b/slideshow/source/engine/soundplayer.cxx @@ -128,7 +128,7 @@ namespace slideshow dispose(); } catch (uno::Exception &) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); } } diff --git a/slideshow/source/engine/waitsymbol.cxx b/slideshow/source/engine/waitsymbol.cxx index 436d058cf598..22fd912d3af7 100644 --- a/slideshow/source/engine/waitsymbol.cxx +++ b/slideshow/source/engine/waitsymbol.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/rendering/XCanvas.hpp> #include <com/sun/star/presentation/XSlideShowView.hpp> +#include <tools/diagnose_ex.h> #include "waitsymbol.hxx" #include <eventmultiplexer.hxx> @@ -130,7 +131,7 @@ void WaitSymbol::viewAdded( const UnoViewSharedPtr& rView ) } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); } maViews.emplace_back( rView, sprite ); diff --git a/slideshow/test/demoshow.cxx b/slideshow/test/demoshow.cxx index 0f3087b82bde..90f9f1336b1f 100644 --- a/slideshow/test/demoshow.cxx +++ b/slideshow/test/demoshow.cxx @@ -520,7 +520,7 @@ void DemoApp::Main() } catch( uno::Exception& ) { - SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) ); + SAL_WARN( "slideshow", exceptionToString( cppu::getCaughtException() ) ); } if( !xFactory.is() ) |