summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-03-01 14:42:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-07 07:12:39 +0100
commit8b5e23eac31cafbd442a3acab5fbcf98bfd0af11 (patch)
treed41feeea533127280e0503d0dc2dd55a4ab83ce8 /desktop
parent4f810905fa74128871f2fe924a3d28a79f4e4261 (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 'desktop')
-rw-r--r--desktop/source/app/app.cxx7
-rw-r--r--desktop/source/app/check_ext_deps.cxx6
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx11
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx6
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx16
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx2
-rw-r--r--desktop/source/lib/init.cxx4
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx6
8 files changed, 37 insertions, 21 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 206d7b096a8a..d2fb9463141f 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -118,13 +118,13 @@
#include <basic/sbstar.hxx>
#include <desktop/crashreport.hxx>
#include <tools/urlobj.hxx>
-
+#include <tools/diagnose_ex.h>
#include <svtools/fontsubstconfig.hxx>
#include <svtools/accessibilityoptions.hxx>
#include <svtools/apearcfg.hxx>
#include <vcl/graphicfilter.hxx>
#include <vcl/window.hxx>
-
+#include <tools/diagnose_ex.h>
#include "langselect.hxx"
#if HAVE_FEATURE_BREAKPAD
@@ -2502,7 +2502,8 @@ IMPL_STATIC_LINK_NOARG(Desktop, AsyncInitFirstRun, Timer *, void)
}
catch(const css::uno::Exception&)
{
- SAL_WARN( "desktop.app", "Desktop::DoFirstRunInitializations: caught an exception while trigger job executor ..." );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "desktop.app", "Desktop::DoFirstRunInitializations: caught an exception while trigger job executor ... " << exceptionToString(ex) );
}
}
diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx
index 15995d99bd64..6fb85c4a685a 100644
--- a/desktop/source/app/check_ext_deps.cxx
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -31,6 +31,7 @@
#include <vcl/timer.hxx>
#include <unotools/configmgr.hxx>
+#include <tools/diagnose_ex.h>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/lok.hxx>
@@ -293,8 +294,9 @@ static bool impl_checkDependencies( const uno::Reference< uno::XComponentContext
bRegistered = false;
}
catch ( const uno::RuntimeException & ) { throw; }
- catch (const uno::Exception & exc) {
- SAL_WARN( "desktop.app", exc );
+ catch (const uno::Exception & ) {
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "desktop.app", exceptionToString(ex) );
}
if ( bRegistered )
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index f38b261882e3..eaab2ff54e72 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -56,6 +56,7 @@
#include <cppuhelper/bootstrap.hxx>
#include <comphelper/processfactory.hxx>
+#include <tools/diagnose_ex.h>
#include <ucbhelper/content.hxx>
#include <unotools/collatorwrapper.hxx>
#include <unotools/configmgr.hxx>
@@ -738,9 +739,10 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker()
{
xFilePicker->appendFilter( elem.first, elem.second );
}
- catch (const lang::IllegalArgumentException & exc)
+ catch (const lang::IllegalArgumentException &)
{
- SAL_WARN( "desktop", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "desktop", exceptionToString(ex) );
}
}
xFilePicker->setCurrentFilter( sDefaultFilter );
@@ -1388,8 +1390,9 @@ bool UpdateRequiredDialog::isEnabled( const uno::Reference< deployment::XPackage
bRegistered = false;
}
catch ( const uno::RuntimeException & ) { throw; }
- catch (const uno::Exception & exc) {
- SAL_WARN( "desktop", exc );
+ catch (const uno::Exception & ) {
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "desktop", exceptionToString(ex) );
bRegistered = false;
}
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index f64538a3c64b..2f74f256e68a 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -33,6 +33,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <sal/log.hxx>
#include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
#include "dp_gui_dialog2.hxx"
#include "dp_gui_extensioncmdqueue.hxx"
@@ -334,8 +335,9 @@ PackageState TheExtensionManager::getPackageState( const uno::Reference< deploym
catch ( const uno::RuntimeException & ) {
throw;
}
- catch (const uno::Exception & exc) {
- SAL_WARN( "desktop", exc );
+ catch (const uno::Exception &) {
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "desktop", exceptionToString(ex) );
return NOT_AVAILABLE;
}
}
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index f73eeb2268b2..12098a26a733 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -33,6 +33,7 @@
#include <rtl/bootstrap.hxx>
#include <sal/log.hxx>
#include <tools/urlobj.hxx>
+#include <tools/diagnose_ex.h>
#include <osl/diagnose.h>
#include <osl/file.hxx>
#include <osl/security.hxx>
@@ -597,10 +598,11 @@ OUString PackageManagerImpl::detectMediaType(
if (xPackageType.is())
mediaType = xPackageType->getMediaType();
}
- catch (const lang::IllegalArgumentException & exc) {
+ catch (const lang::IllegalArgumentException &) {
if (throw_exc)
throw;
- SAL_WARN( "desktop", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "desktop", exceptionToString(ex) );
}
}
return mediaType;
@@ -1037,13 +1039,15 @@ PackageManagerImpl::getDeployedPackages_(
true /* xxx todo: think of GUI:
ignore other platforms than the current one */ ) );
}
- catch (const lang::IllegalArgumentException & exc) {
+ catch (const lang::IllegalArgumentException &) {
+ css::uno::Any ex( cppu::getCaughtException() );
// ignore
- SAL_WARN( "desktop", exc );
+ SAL_WARN( "desktop", exceptionToString(ex) );
}
- catch (const deployment::DeploymentException& exc) {
+ catch (const deployment::DeploymentException&) {
+ css::uno::Any ex( cppu::getCaughtException() );
// ignore
- SAL_WARN( "desktop", exc );
+ SAL_WARN( "desktop", exceptionToString(ex) );
}
}
return comphelper::containerToSequence(packages);
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 380de3eb28cd..5e16ef6b862a 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -1058,7 +1058,7 @@ void BackendImpl::PackageImpl::exportTo(
SAL_WARN( "desktop", exceptionToString( cppu::getCaughtException() ) );
}
catch (const lang::IllegalArgumentException & exc) {
- SAL_WARN( "desktop", exc );
+ SAL_WARN( "desktop", exceptionToString(Any(exc)) );
}
std::vector< Sequence<beans::PropertyValue> > manifest;
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a24a12c99647..6e254d961331 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -133,6 +133,7 @@
#include <i18nlangtag/languagetag.hxx>
#include <vcl/builder.hxx>
#include <vcl/abstdlg.hxx>
+#include <tools/diagnose_ex.h>
#include <app.hxx>
@@ -2800,9 +2801,10 @@ static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOu
}
catch (const uno::Exception& exception)
{
+ css::uno::Any exAny( cppu::getCaughtException() );
if (gImpl)
gImpl->maLastExceptionMsg = exception.Message;
- SAL_WARN("lok", "Failed to render shape selection: " << exception);
+ SAL_WARN("lok", "Failed to render shape selection: " << exceptionToString(exAny));
}
return 0;
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index 2cb0ebf0dec3..c17e2ccbb9d1 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -27,6 +27,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <comphelper/anytostring.hxx>
+#include <tools/diagnose_ex.h>
#include <unotools/configmgr.hxx>
#include <com/sun/star/lang/WrappedTargetException.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp>
@@ -120,8 +121,9 @@ CommandEnvironmentImpl::~CommandEnvironmentImpl()
if (xComp.is())
xComp->dispose();
}
- catch (const RuntimeException & exc) {
- SAL_WARN( "desktop", exc );
+ catch (const RuntimeException &) {
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "desktop", exceptionToString(ex) );
}
}