diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-15 10:44:08 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-08-05 21:06:51 -0400 |
commit | 90258c5001c862cfd03f829d4aab2feac240eef6 (patch) | |
tree | 0abc1781eeca085a7eae5b9aa0cf0a41bcd8f6e8 /unotools | |
parent | 985223a77d078412e5caacfc2fc06da65d821da4 (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')
-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; } |