summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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 'sd')
-rw-r--r--sd/source/core/stlsheet.cxx6
-rw-r--r--sd/source/filter/xml/sdxmlwrp.cxx25
-rw-r--r--sd/source/helper/simplereferencecomponent.cxx6
-rw-r--r--sd/source/ui/accessibility/AccessiblePageShape.cxx4
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.cxx36
-rw-r--r--sd/source/ui/framework/module/ModuleController.cxx3
-rw-r--r--sd/source/ui/tools/ConfigurationAccess.cxx5
-rw-r--r--sd/source/ui/unoidl/DrawController.cxx6
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx6
9 files changed, 62 insertions, 35 deletions
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 81b465775e8c..4e81c7304a5c 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -42,6 +42,7 @@
#include <svx/unoshprp.hxx>
#include <svx/unoshape.hxx>
#include <svx/svdpool.hxx>
+#include <tools/diagnose_ex.h>
#include <stlsheet.hxx>
#include <sdresid.hxx>
#include <sdpage.hxx>
@@ -700,9 +701,10 @@ void SAL_CALL SdStyleSheet::release( ) throw ()
{
dispose();
}
- catch (RuntimeException const& exc)
+ catch (RuntimeException const&)
{ // don't break throw ()
- SAL_WARN( "sd", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd", exceptionToString(ex) );
}
OSL_ASSERT( mrBHelper.bDisposed );
SdStyleSheetBase::release();
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 6c038cb5dac6..8609f758c46a 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -74,6 +74,7 @@
#include <strings.hrc>
#include <sfx2/frame.hxx>
+#include <tools/diagnose_ex.h>
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -227,6 +228,7 @@ ErrCode ReadThroughComponent(
}
catch (const xml::sax::SAXParseException& r)
{
+ css::uno::Any ex( cppu::getCaughtException() );
// sax parser sends wrapped exceptions,
// try to find the original one
xml::sax::SAXException aSaxEx = *static_cast<xml::sax::SAXException const *>(&r);
@@ -248,7 +250,7 @@ ErrCode ReadThroughComponent(
if( bEncrypted )
return ERRCODE_SFX_WRONGPASSWORD;
- SAL_WARN( "sd.filter", "SAX parse exception caught while importing:" << r);
+ SAL_WARN( "sd.filter", "SAX parse exception caught while importing: " << exceptionToString(ex));
OUString sErr( OUString::number( r.LineNumber ));
sErr += ",";
@@ -271,6 +273,7 @@ ErrCode ReadThroughComponent(
}
catch (const xml::sax::SAXException& r)
{
+ css::uno::Any ex( cppu::getCaughtException() );
packages::zip::ZipIOException aBrokenPackage;
if ( r.WrappedException >>= aBrokenPackage )
return ERRCODE_IO_BROKENPACKAGE;
@@ -278,22 +281,25 @@ ErrCode ReadThroughComponent(
if( bEncrypted )
return ERRCODE_SFX_WRONGPASSWORD;
- SAL_WARN( "sd.filter", "SAX exception caught while importing:" << r);
+ SAL_WARN( "sd.filter", "SAX exception caught while importing: " << exceptionToString(ex));
return SD_XML_READERROR;
}
- catch (const packages::zip::ZipIOException& r)
+ catch (const packages::zip::ZipIOException&)
{
- SAL_WARN( "sd.filter", "Zip exception caught while importing:" << r);
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd.filter", "Zip exception caught while importing: " << exceptionToString(ex));
return ERRCODE_IO_BROKENPACKAGE;
}
- catch (const io::IOException& r)
+ catch (const io::IOException&)
{
- SAL_WARN( "sd.filter", "IO exception caught while importing:" << r);
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd.filter", "IO exception caught while importing: " << exceptionToString(ex));
return SD_XML_READERROR;
}
- catch (const uno::Exception& r)
+ catch (const uno::Exception&)
{
- SAL_WARN( "sd.filter", "uno exception caught while importing:" << r);
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd.filter", "uno exception caught while importing: " << exceptionToString(ex));
return SD_XML_READERROR;
}
@@ -716,7 +722,8 @@ bool SdXMLFilter::Import( ErrCode& nError )
}
catch (const Exception&)
{
- SAL_WARN( "sd.filter","sd::SdXMLFilter::Import(), exception during clearing of unused named items");
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd.filter","sd::SdXMLFilter::Import(), exception during clearing of unused named items " << exceptionToString(ex));
}
}
diff --git a/sd/source/helper/simplereferencecomponent.cxx b/sd/source/helper/simplereferencecomponent.cxx
index e47341b85ba3..23a1fe108c4a 100644
--- a/sd/source/helper/simplereferencecomponent.cxx
+++ b/sd/source/helper/simplereferencecomponent.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <osl/diagnose.h>
#include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
using com::sun::star::uno::RuntimeException;
using sd::SimpleReferenceComponent;
@@ -51,9 +52,10 @@ void SimpleReferenceComponent::release()
{
Dispose();
}
- catch (RuntimeException & exc ) // don't break throw ()
+ catch (RuntimeException const &) // don't break throw ()
{
- SAL_WARN( "sd", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd", exceptionToString(ex) );
}
}
diff --git a/sd/source/ui/accessibility/AccessiblePageShape.cxx b/sd/source/ui/accessibility/AccessiblePageShape.cxx
index 21cf52790532..05d97557882f 100644
--- a/sd/source/ui/accessibility/AccessiblePageShape.cxx
+++ b/sd/source/ui/accessibility/AccessiblePageShape.cxx
@@ -20,6 +20,7 @@
#include <AccessiblePageShape.hxx>
#include <svx/AccessibleShapeInfo.hxx>
#include <svx/IAccessibleViewForwarder.hxx>
+#include <tools/diagnose_ex.h>
#include <tools/gen.hxx>
#include <sal/log.hxx>
@@ -201,7 +202,8 @@ sal_Int32 SAL_CALL AccessiblePageShape::getBackground()
}
catch (const css::beans::UnknownPropertyException&)
{
- SAL_WARN("sd", "caught exception due to unknown property");
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN("sd", "caught exception due to unknown property " << exceptionToString(ex));
// Ignore exception and return default color.
}
return nColor;
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index bf03cd86b415..094aa8e1e97b 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -32,6 +32,7 @@
#include <svx/unoshape.hxx>
#include <svx/xfltrit.hxx>
#include <svx/xfillit.hxx>
+#include <tools/diagnose_ex.h>
#include <xmloff/autolayout.hxx>
#include "PhotoAlbumDialog.hxx"
@@ -166,9 +167,10 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, weld::Button&, void)
if (bCreateCaptions)
createCaption( aPageSize );
}
- catch (const css::uno::Exception& exc)
+ catch (const css::uno::Exception&)
{
- SAL_WARN( "sd", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd", exceptionToString(ex) );
}
}
}
@@ -230,9 +232,10 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, weld::Button&, void)
{
xSlide->add(xShape);
}
- catch (const css::uno::Exception& exc)
+ catch (const css::uno::Exception&)
{
- SAL_WARN( "sd", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd", exceptionToString(ex) );
}
}
@@ -277,9 +280,10 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, weld::Button&, void)
if(bCreateCaptions)
createCaption( aPageSize );
}
- catch (const css::uno::Exception& exc)
+ catch (const css::uno::Exception&)
{
- SAL_WARN( "sd", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd", exceptionToString(ex) );
}
}
}
@@ -349,9 +353,10 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, weld::Button&, void)
{
xSlide->add(xShape);
}
- catch (const css::uno::Exception& exc)
+ catch (const css::uno::Exception&)
{
- SAL_WARN( "sd", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd", exceptionToString(ex) );
}
}
if( !sUrl2.isEmpty() )
@@ -392,9 +397,10 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, weld::Button&, void)
{
xSlide->add(xShape);
}
- catch (const css::uno::Exception& exc)
+ catch (const css::uno::Exception&)
{
- SAL_WARN( "sd", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd", exceptionToString(ex) );
}
}
if( !sUrl3.isEmpty() )
@@ -435,9 +441,10 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, weld::Button&, void)
{
xSlide->add(xShape);
}
- catch (const css::uno::Exception& exc)
+ catch (const css::uno::Exception&)
{
- SAL_WARN( "sd", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd", exceptionToString(ex) );
}
}
if( !sUrl4.isEmpty() )
@@ -480,9 +487,10 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, weld::Button&, void)
if(bCreateCaptions)
createCaption( aPageSize );
}
- catch (const css::uno::Exception& exc)
+ catch (const css::uno::Exception&)
{
- SAL_WARN( "sd", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd", exceptionToString(ex) );
}
}
}
diff --git a/sd/source/ui/framework/module/ModuleController.cxx b/sd/source/ui/framework/module/ModuleController.cxx
index d827d282fd40..20ddc1cf1871 100644
--- a/sd/source/ui/framework/module/ModuleController.cxx
+++ b/sd/source/ui/framework/module/ModuleController.cxx
@@ -230,7 +230,8 @@ void SAL_CALL ModuleController::requestResource (const OUString& rsResourceURL)
}
catch (const Exception&)
{
- SAL_WARN("sd.fwk", "caught exception while creating factory.");
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN("sd.fwk", "caught exception while creating factory. " << exceptionToString(ex));
}
// Remember that this factory has been instanced.
diff --git a/sd/source/ui/tools/ConfigurationAccess.cxx b/sd/source/ui/tools/ConfigurationAccess.cxx
index b62a26d0c113..dcee221eee52 100644
--- a/sd/source/ui/tools/ConfigurationAccess.cxx
+++ b/sd/source/ui/tools/ConfigurationAccess.cxx
@@ -106,9 +106,10 @@ Any ConfigurationAccess::GetConfigurationNode (
return rxNode->getByHierarchicalName(sPathToNode);
}
}
- catch (const Exception& rException)
+ catch (const Exception&)
{
- SAL_WARN("sd", "caught exception while getting configuration node" << sPathToNode << ": " << rException);
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN("sd", "caught exception while getting configuration node" << sPathToNode << ": " << exceptionToString(ex));
}
return Any();
diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx
index 2085e77b2d74..1acea57a3cb3 100644
--- a/sd/source/ui/unoidl/DrawController.cxx
+++ b/sd/source/ui/unoidl/DrawController.cxx
@@ -48,6 +48,7 @@
#include <vcl/svapp.hxx>
#include <vcl/EnumContext.hxx>
#include <svx/sidebar/ContextChangeEventMultiplexer.hxx>
+#include <tools/diagnose_ex.h>
#include <memory>
@@ -425,9 +426,10 @@ void DrawController::FireSwitchCurrentPage (SdPage* pNewCurrentPage) throw()
mpCurrentPage.reset(pNewCurrentPage);
}
- catch (const uno::Exception& e)
+ catch (const uno::Exception&)
{
- SAL_WARN("sd", "sd::SdUnoDrawView::FireSwitchCurrentPage(), exception caught: " << e);
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN("sd", "sd::SdUnoDrawView::FireSwitchCurrentPage(), exception caught: " << exceptionToString(ex));
}
}
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index ca453c80d2b5..41cd4ad24a27 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -125,6 +125,7 @@
#include <drawinglayer/primitive2d/structuretagprimitive2d.hxx>
#include <sfx2/lokcharthelper.hxx>
+#include <tools/diagnose_ex.h>
#define TWIPS_PER_PIXEL 15
@@ -326,9 +327,10 @@ void SAL_CALL SdXImpressDocument::release() throw ( )
{
dispose();
}
- catch (const uno::RuntimeException& exc)
+ catch (const uno::RuntimeException&)
{ // don't break throw ()
- SAL_WARN( "sd", exc );
+ css::uno::Any ex( cppu::getCaughtException() );
+ SAL_WARN( "sd", exceptionToString(ex) );
}
}
SfxBaseModel::release();