From 8b5e23eac31cafbd442a3acab5fbcf98bfd0af11 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 1 Mar 2019 14:42:38 +0200 Subject: log nice exception messages whereever possible Change-Id: Idd125c18bee1a39b9ea8cc4f8c55cddfd37c33e1 Reviewed-on: https://gerrit.libreoffice.org/68579 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/source/chart/XMLChartStyleContext.cxx | 4 +++- xmloff/source/core/xmlimp.cxx | 3 ++- xmloff/source/draw/shapeexport.cxx | 3 ++- xmloff/source/table/XMLTableExport.cxx | 13 +++++++++---- xmloff/source/table/XMLTableImport.cxx | 9 ++++++--- 5 files changed, 22 insertions(+), 10 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/chart/XMLChartStyleContext.cxx b/xmloff/source/chart/XMLChartStyleContext.cxx index ceee2fd60b5c..43769342a293 100644 --- a/xmloff/source/chart/XMLChartStyleContext.cxx +++ b/xmloff/source/chart/XMLChartStyleContext.cxx @@ -27,6 +27,7 @@ #include #include +#include #include "XMLChartPropertyContext.hxx" @@ -102,7 +103,8 @@ void XMLChartStyleContext::FillPropertySet( } catch( beans::UnknownPropertyException& ) { - SAL_WARN( "xmloff", "unknown property exception -> shape style not completely imported for chart style" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "xmloff", "unknown property exception -> shape style not completely imported for chart style " << exceptionToString(ex) ); } lcl_NumberFormatStyleToProperty( msDataStyleName, "NumberFormat", mrStyles, rPropSet ); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 6913eb475ef7..561e3d5aa3c3 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1989,7 +1989,8 @@ void SvXMLImport::SetXmlId(uno::Reference const & i_xIfc, } } } catch (uno::Exception &) { - SAL_WARN("xmloff.core","SvXMLImport::SetXmlId: exception?"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("xmloff.core","SvXMLImport::SetXmlId: exception " << exceptionToString(ex)); } } } diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 4e32eba229d8..04d4f2813aa0 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -628,7 +628,8 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape } catch(const uno::Exception&) { - SAL_WARN("xmloff", "XMLShapeExport::exportShape(): exception during hyperlink export"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("xmloff", "XMLShapeExport::exportShape(): exception during hyperlink export " << exceptionToString(ex)); } if( xSet.is() ) diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index 5fc0ff9c8d34..39eb2d530afd 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -593,7 +594,8 @@ void XMLTableExport::exportTableTemplates() } catch(const Exception&) { - SAL_WARN("xmloff", "XMLTableExport::exportTableTemplates(), export Writer specific attributes, exception caught!"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("xmloff", "XMLTableExport::exportTableTemplates(), export Writer specific attributes, exception caught! " << exceptionToString(ex)); } pElements++; } @@ -650,7 +652,8 @@ void XMLTableExport::exportTableTemplates() } catch(const Exception&) { - SAL_WARN("xmloff", "XMLTableExport::exportTableTemplates(), export Writer specific styles, exception caught!"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("xmloff", "XMLTableExport::exportTableTemplates(), export Writer specific styles, exception caught!" << exceptionToString(ex)); } pElements++; } @@ -658,12 +661,14 @@ void XMLTableExport::exportTableTemplates() } catch(const Exception&) { - OSL_FAIL("xmloff::XMLTableExport::exportTableDesigns(), exception caught while exporting a table design!"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("xmloff", "XMLTableExport::exportTableDesigns(), exception caught while exporting a table design! " << exceptionToString(ex)); } } catch(const Exception&) { - OSL_FAIL("xmloff::XMLTableExport::exportTableDesigns(), exception caught!"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("xmloff", "XMLTableExport::exportTableDesigns(), exception caught! " << exceptionToString(ex)); } } diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx index 2f7ba902da3b..2cf7423f6411 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -291,9 +292,10 @@ void XMLTableImport::insertTabletemplate(const OUString& rsStyleName, bool bOver } } } - catch (Exception&) + catch (Exception const &) { - SAL_WARN("xmloff.table", "XMLTableImport::insertTabletemplate(), exception caught!"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("xmloff.table", "XMLTableImport::insertTabletemplate(), exception caught!" << exceptionToString(ex)); } if (xTemplate.is()) @@ -306,7 +308,8 @@ void XMLTableImport::insertTabletemplate(const OUString& rsStyleName, bool bOver } catch (Exception&) { - SAL_WARN("xmloff.table", "XMLTableImport::insertTabletemplate(), exception caught!"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("xmloff.table", "XMLTableImport::insertTabletemplate(), exception caught!" << exceptionToString(ex)); } } -- cgit v1.2.3