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 /unotools/source | |
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 'unotools/source')
-rw-r--r-- | unotools/source/ucbhelper/ucbhelper.cxx | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 80580698d88d..10cc0e1a65f0 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -56,6 +56,7 @@ #include <sal/types.h> #include <tools/datetime.hxx> #include <tools/urlobj.hxx> +#include <tools/diagnose_ex.h> #include <ucbhelper/commandenvironment.hxx> #include <ucbhelper/content.hxx> #include <unotools/ucbhelper.hxx> @@ -102,8 +103,7 @@ std::vector<OUString> getContents(OUString const & url) { css::uno::Any e(cppu::getCaughtException()); SAL_INFO( "unotools.ucbhelper", - "getContents(" << url << ") " << e.getValueType().getTypeName() - << " \"" << e.get<css::uno::Exception>() << '"'); + "getContents(" << url << ") " << exceptionToString(e)); return std::vector<OUString>(); } } @@ -151,8 +151,7 @@ bool utl::UCBContentHelper::IsDocument(OUString const & url) { SAL_INFO( "unotools.ucbhelper", "UCBContentHelper::IsDocument(" << url << ") " - << e.getValueType().getTypeName() << " \"" - << e.get<css::uno::Exception>() << '"'); + << exceptionToString(e)); return false; } } @@ -172,8 +171,7 @@ css::uno::Any utl::UCBContentHelper::GetProperty( SAL_INFO( "unotools.ucbhelper", "UCBContentHelper::GetProperty(" << url << ", " << property << ") " - << e.getValueType().getTypeName() << " \"" - << e.get<css::uno::Exception>() << '"'); + << exceptionToString(e)); return css::uno::Any(); } } @@ -191,8 +189,7 @@ bool utl::UCBContentHelper::IsFolder(OUString const & url) { SAL_INFO( "unotools.ucbhelper", "UCBContentHelper::IsFolder(" << url << ") " - << e.getValueType().getTypeName() << " \"" - << e.get<css::uno::Exception>() << '"'); + << exceptionToString(e)); return false; } } @@ -213,8 +210,7 @@ bool utl::UCBContentHelper::GetTitle( SAL_INFO( "unotools.ucbhelper", "UCBContentHelper::GetTitle(" << url << ") " - << e.getValueType().getTypeName() << " \"" - << e.get<css::uno::Exception>() << '"'); + << exceptionToString(e)); return false; } } @@ -235,8 +231,7 @@ bool utl::UCBContentHelper::Kill(OUString const & url) { SAL_INFO( "unotools.ucbhelper", "UCBContentHelper::Kill(" << url << ") " - << e.getValueType().getTypeName() << " \"" - << e.get<css::uno::Exception>() << '"'); + << exceptionToString(e)); return false; } } @@ -291,8 +286,7 @@ bool utl::UCBContentHelper::MakeFolder( SAL_INFO( "unotools.ucbhelper", "UCBContentHelper::MakeFolder(" << title << ") " - << e.getValueType().getTypeName() << " \"" - << e.get<css::uno::Exception>() << '"'); + << exceptionToString(e)); } if (exists) { INetURLObject o(parent.getURL()); @@ -327,8 +321,7 @@ bool utl::UCBContentHelper::IsYounger( SAL_INFO( "unotools.ucbhelper", "UCBContentHelper::IsYounger(" << younger << ", " << older << ") " - << e.getValueType().getTypeName() << " \"" - << e.get<css::uno::Exception>() << '"'); + << exceptionToString(e)); return false; } } @@ -412,8 +405,7 @@ bool utl::UCBContentHelper::IsSubPath( SAL_INFO( "unotools.ucbhelper", "UCBContentHelper::IsSubPath(" << parent << ", " << child << ") " - << e.getValueType().getTypeName() << " \"" - << e.get<css::uno::Exception>() << '"'); + << exceptionToString(e)); } return false; } |