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 /vcl | |
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 'vcl')
-rw-r--r-- | vcl/source/app/salusereventlist.cxx | 5 | ||||
-rw-r--r-- | vcl/source/app/scheduler.cxx | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/vcl/source/app/salusereventlist.cxx b/vcl/source/app/salusereventlist.cxx index 1ccbeea03438..b71b5ed2031a 100644 --- a/vcl/source/app/salusereventlist.cxx +++ b/vcl/source/app/salusereventlist.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/uno/Exception.hpp> #include <cppuhelper/exc_hlp.hxx> #include <tools/debug.hxx> +#include <tools/diagnose_ex.h> #include <sal/log.hxx> #include <sal/types.h> #include <svdata.hxx> @@ -109,10 +110,10 @@ bool SalUserEventList::DispatchUserEvents( bool bHandleAllCurrentEvents ) { ProcessEvent( aEvent ); } - catch (css::uno::Exception& e) + catch (css::uno::Exception&) { auto const e2 = cppu::getCaughtException(); - SAL_WARN("vcl", "Uncaught " << e2.getValueTypeName() << " " << e.Message); + SAL_WARN("vcl", "Uncaught " << exceptionToString(e2)); std::abort(); } catch (std::exception& e) diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx index 53d1dafcfd07..39fe10322902 100644 --- a/vcl/source/app/scheduler.cxx +++ b/vcl/source/app/scheduler.cxx @@ -31,6 +31,7 @@ #include <svdata.hxx> #include <tools/time.hxx> #include <tools/debug.hxx> +#include <tools/diagnose_ex.h> #include <unotools/configmgr.hxx> #include <vcl/scheduler.hxx> #include <vcl/idle.hxx> @@ -473,10 +474,10 @@ bool Scheduler::ProcessTaskScheduling() { pTask->Invoke(); } - catch (css::uno::Exception& e) + catch (css::uno::Exception&) { - auto const e2 = cppu::getCaughtException(); - SAL_WARN("vcl.schedule", "Uncaught " << e2.getValueTypeName() << " " << e.Message); + auto const ex = cppu::getCaughtException(); + SAL_WARN("vcl.schedule", "Uncaught " << exceptionToString(ex)); std::abort(); } catch (std::exception& e) |