avmedia/source/framework/mediaitem.cxx | 6 basctl/source/basicide/scriptdocument.cxx | 5 basic/source/classes/sbxmod.cxx | 4 basic/source/runtime/runtime.cxx | 4 chart2/source/tools/ErrorBar.cxx | 9 connectivity/Library_dbpool2.mk | 1 connectivity/source/commontools/parameters.cxx | 21 - connectivity/source/cpool/ZPoolCollection.cxx | 4 connectivity/source/drivers/file/FDatabaseMetaData.cxx | 4 cui/source/customize/CommandCategoryListBox.cxx | 6 cui/source/customize/cfg.cxx | 46 -- cui/source/dialogs/scriptdlg.cxx | 21 - cui/source/options/optjava.cxx | 6 cui/source/options/optlingu.cxx | 4 cui/source/options/optpath.cxx | 5 cui/source/options/optsave.cxx | 6 cui/source/options/optupdt.cxx | 9 cui/source/options/treeopt.cxx | 25 - dbaccess/source/core/api/RowSet.cxx | 5 dbaccess/source/core/dataaccess/databasedocument.cxx | 5 dbaccess/source/core/dataaccess/datasource.cxx | 3 dbaccess/source/ui/misc/UITools.cxx | 5 desktop/source/app/app.cxx | 7 desktop/source/app/check_ext_deps.cxx | 6 desktop/source/deployment/gui/dp_gui_dialog2.cxx | 11 desktop/source/deployment/gui/dp_gui_theextmgr.cxx | 6 desktop/source/deployment/manager/dp_manager.cxx | 16 desktop/source/deployment/registry/package/dp_package.cxx | 2 desktop/source/lib/init.cxx | 4 desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx | 6 editeng/source/xml/xmltxtexp.cxx | 6 extensions/CppunitTest_extensions_test_update.mk | 1 extensions/Library_updchk.mk | 1 extensions/source/bibliography/datman.cxx | 5 extensions/source/dbpilots/listcombowizard.cxx | 4 extensions/source/propctrlr/eformspropertyhandler.cxx | 4 extensions/source/update/check/updatecheck.cxx | 11 extensions/source/update/check/updatecheckjob.cxx | 11 extensions/source/update/feed/test/updatefeedtest.cxx | 4 filter/Library_icg.mk | 3 filter/source/graphicfilter/icgm/cgm.cxx | 6 filter/source/odfflatxml/OdfFlatXml.cxx | 6 filter/source/xsltfilter/XSLTFilter.cxx | 6 forms/source/component/ListBox.cxx | 3 forms/source/misc/InterfaceContainer.cxx | 3 formula/source/ui/dlg/formula.cxx | 10 include/o3tl/deleter.hxx | 4 include/toolkit/helper/macros.hxx | 15 io/Library_io.mk | 1 io/source/stm/opump.cxx | 27 - javaunohelper/Library_juhx.mk | 1 javaunohelper/source/bootstrap.cxx | 7 linguistic/source/convdiclist.cxx | 4 linguistic/source/gciterator.cxx | 11 oox/source/drawingml/textfield.cxx | 4 oox/source/drawingml/textrun.cxx | 4 oox/source/ole/axcontrol.cxx | 11 oox/source/vml/vmldrawing.cxx | 5 sax/Library_expwrap.mk | 1 sax/source/fastparser/fastparser.cxx | 4 sc/source/core/data/dpsave.cxx | 7 sc/source/filter/oox/excelfilter.cxx | 6 sc/source/filter/oox/pivotcachebuffer.cxx | 11 sc/source/filter/xml/xmlwrap.cxx | 22 - sc/source/ui/Accessibility/DrawModelBroadcaster.cxx | 6 sd/source/core/stlsheet.cxx | 6 sd/source/filter/xml/sdxmlwrp.cxx | 25 - sd/source/helper/simplereferencecomponent.cxx | 6 sd/source/ui/accessibility/AccessiblePageShape.cxx | 4 sd/source/ui/dlg/PhotoAlbumDialog.cxx | 36 + sd/source/ui/framework/module/ModuleController.cxx | 3 sd/source/ui/tools/ConfigurationAccess.cxx | 5 sd/source/ui/unoidl/DrawController.cxx | 6 sd/source/ui/unoidl/unomodel.cxx | 6 sdext/source/minimizer/configurationaccess.cxx | 6 sdext/source/presenter/PresenterConfigurationAccess.cxx | 5 sdext/source/presenter/PresenterTextView.cxx | 4 sfx2/source/appl/appdde.cxx | 15 sfx2/source/appl/appserv.cxx | 3 sfx2/source/appl/newhelp.cxx | 26 - sfx2/source/appl/sfxhelp.cxx | 7 sfx2/source/bastyp/helper.cxx | 23 - sfx2/source/dialog/backingwindow.cxx | 6 sfx2/source/dialog/dinfdlg.cxx | 11 sfx2/source/dialog/filedlghelper.cxx | 13 sfx2/source/doc/DocumentMetadataAccess.cxx | 4 sfx2/source/doc/docfile.cxx | 10 sfx2/source/doc/doctempl.cxx | 4 sfx2/source/doc/doctemplates.cxx | 9 solenv/bin/macosx-change-install-names.pl | 1 svl/source/config/itemholder2.cxx | 6 svtools/source/contnr/contentenumeration.cxx | 11 svx/source/accessibility/AccessibleShape.cxx | 4 svx/source/form/datanavi.cxx | 281 ++++++++------ svx/source/svdraw/svdmodel.cxx | 6 svx/source/svdraw/svdomedia.cxx | 6 svx/source/tbxctrls/tbxcolor.cxx | 6 sw/source/core/access/accmap.cxx | 6 sw/source/core/edit/edundo.cxx | 16 sw/source/filter/ww8/docxexport.cxx | 4 sw/source/filter/xml/swxml.cxx | 24 - sw/source/filter/xml/xmlfmt.cxx | 7 sw/source/ui/vba/vbadocumentproperties.cxx | 4 sw/source/uibase/dbui/dbmgr.cxx | 21 - sw/source/uibase/dbui/mmconfigitem.cxx | 16 toolkit/source/controls/controlmodelcontainerbase.cxx | 6 toolkit/source/controls/tree/treecontrol.cxx | 9 toolkit/source/helper/listenermultiplexer.cxx | 5 ucb/Library_ucpexpand1.mk | 1 ucb/source/core/ucbstore.cxx | 4 ucb/source/ucp/expand/ucpexpand.cxx | 6 unotools/source/config/itemholder1.cxx | 6 unotools/source/config/viewoptions.cxx | 74 ++- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 5 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 10 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 xmlsecurity/source/dialogs/macrosecurity.cxx | 4 121 files changed, 795 insertions(+), 526 deletions(-)
New commits: commit 8b5e23eac31cafbd442a3acab5fbcf98bfd0af11 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Mar 1 14:42:38 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Mar 7 07:12:39 2019 +0100 log nice exception messages whereever possible Change-Id: Idd125c18bee1a39b9ea8cc4f8c55cddfd37c33e1 Reviewed-on: https://gerrit.libreoffice.org/68579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/avmedia/source/framework/mediaitem.cxx b/avmedia/source/framework/mediaitem.cxx index 0fca80f6d5b4..9a1a33ea5473 100644 --- a/avmedia/source/framework/mediaitem.cxx +++ b/avmedia/source/framework/mediaitem.cxx @@ -39,6 +39,7 @@ #include <comphelper/storagehelper.hxx> #include <mediamisc.hxx> #include <osl/file.hxx> +#include <tools/diagnose_ex.h> using namespace ::com::sun::star; @@ -506,9 +507,10 @@ bool CreateMediaTempFile(uno::Reference<io::XInputStream> const& xInStream, comphelper::getProcessComponentContext()); tempContent.writeStream(xInStream, true); // copy stream to file } - catch (uno::Exception const& e) + catch (uno::Exception const&) { - SAL_WARN("avmedia", "exception: '" << e << "'"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("avmedia", "exception: " << exceptionToString(ex)); return false; } o_rTempFileURL = tempFileURL; diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index 9f4a919632f4..e6daf0ca6dfc 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -408,9 +408,10 @@ namespace basctl return ::basic::BasicManagerRepository::getDocumentBasicManager( m_xDocument ); } - catch (const css::ucb::ContentCreationException& e) + catch (const css::ucb::ContentCreationException&) { - SAL_WARN( "basctl.basicide", "ScriptDocument::getBasicManager: Caught exception: " << e ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "basctl.basicide", "ScriptDocument::getBasicManager: Caught exception: " << exceptionToString(ex) ); } return nullptr; } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 23a279485afa..7e65e2e588a2 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -20,6 +20,7 @@ #include <vcl/svapp.hxx> #include <tools/stream.hxx> +#include <tools/diagnose_ex.h> #include <svl/SfxBroadcaster.hxx> #include <basic/sbx.hxx> #include <basic/sbuno.hxx> @@ -145,7 +146,8 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ) } catch(const Exception& ) { - SAL_WARN( "basic", "DocObjectWrapper::DocObjectWrapper: Caught exception!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "basic", "DocObjectWrapper::DocObjectWrapper: Caught exception! " << exceptionToString(ex) ); } } diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index ea0d9ae69379..0e1ace2e349b 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -36,6 +36,7 @@ #include <sal/log.hxx> #include <tools/wldcrd.hxx> +#include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> @@ -343,7 +344,8 @@ SbiInstance::~SbiInstance() } catch( const Exception& ) { - SAL_WARN("basic", "SbiInstance::~SbiInstance: caught an exception while disposing the components!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("basic", "SbiInstance::~SbiInstance: caught an exception while disposing the components! " << exceptionToString(ex) ); } } diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index 8cb31099d166..04512746c8d6 100644 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -209,11 +209,18 @@ OUString getSourceRangeStrFromLabeledSequences( const uno::Sequence< uno::Refere } } } + catch (uno::Exception const &) + { + css::uno::Any ex( cppu::getCaughtException() ); + // we can't be sure that this is 100% safe and we don't want to kill the export + // we should at least check why the exception is thrown + SAL_WARN("chart2", "unexpected exception! " << exceptionToString(ex)); + } catch (...) { // we can't be sure that this is 100% safe and we don't want to kill the export // we should at least check why the exception is thrown - SAL_WARN("chart2", "unexpected exception!"); + SAL_WARN("chart2", "unexpected exception! "); } } diff --git a/connectivity/Library_dbpool2.mk b/connectivity/Library_dbpool2.mk index 0e1d1fc19a3f..38b3cd197f01 100644 --- a/connectivity/Library_dbpool2.mk +++ b/connectivity/Library_dbpool2.mk @@ -29,6 +29,7 @@ $(eval $(call gb_Library_use_libraries,dbpool2,\ dbtools \ sal \ salhelper \ + tl \ )) $(eval $(call gb_Library_add_exception_objects,dbpool2,\ diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx index e03c6064c7cf..8ab930dc2d3f 100644 --- a/connectivity/source/commontools/parameters.cxx +++ b/connectivity/source/commontools/parameters.cxx @@ -197,7 +197,8 @@ namespace dbtools } catch( const Exception& ) { - SAL_WARN( "connectivity.commontools", "ParameterManager::collectInnerParameters: caught an exception!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "connectivity.commontools", "ParameterManager::collectInnerParameters: caught an exception! " << exceptionToString(ex) ); } } } @@ -426,7 +427,8 @@ namespace dbtools } catch( const Exception& ) { - SAL_WARN( "connectivity.commontools", "ParameterManager::analyzeFieldLinks: caught an exception!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "connectivity.commontools", "ParameterManager::analyzeFieldLinks: caught an exception! " << exceptionToString(ex) ); } } @@ -664,7 +666,8 @@ namespace dbtools } catch( const Exception& ) { - SAL_WARN( "connectivity.commontools", "ParameterManager::completeParameters: caught an exception while calling the handler!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "connectivity.commontools", "ParameterManager::completeParameters: caught an exception while calling the handler! " << exceptionToString(ex) ); } if ( !pParams->wasSelected() ) @@ -694,7 +697,8 @@ namespace dbtools } catch( const Exception& ) { - SAL_WARN( "connectivity.commontools", "ParameterManager::completeParameters: caught an exception while propagating the values!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "connectivity.commontools", "ParameterManager::completeParameters: caught an exception while propagating the values! " << exceptionToString(ex) ); } return true; } @@ -788,7 +792,8 @@ namespace dbtools } catch( const Exception& ) { - SAL_WARN( "connectivity.commontools", "ParameterManager::cacheConnectionInfo: caught an exception!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "connectivity.commontools", "ParameterManager::cacheConnectionInfo: caught an exception! " << exceptionToString(ex) ); } } @@ -844,7 +849,8 @@ namespace dbtools } catch( const Exception& ) { - SAL_WARN( "connectivity.commontools", "ParameterManager::getParentColumns: caught an exception!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "connectivity.commontools", "ParameterManager::getParentColumns: caught an exception! " << exceptionToString(ex) ); } return _out_rxParentColumns.is(); } @@ -940,7 +946,8 @@ namespace dbtools } catch( const Exception& ) { - SAL_WARN( "connectivity.commontools", "ParameterManager::resetParameterValues: caught an exception!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "connectivity.commontools", "ParameterManager::resetParameterValues: caught an exception! " << exceptionToString(ex) ); } } diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx index 3318e89c7d91..86393c6319ce 100644 --- a/connectivity/source/cpool/ZPoolCollection.cxx +++ b/connectivity/source/cpool/ZPoolCollection.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <osl/diagnose.h> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -364,7 +365,8 @@ Reference<XInterface> OPoolCollection::openNode(const OUString& _rPath,const Ref } catch(Exception&) { - SAL_WARN("connectivity.cpool", "OConfigurationNode::openNode: caught an exception while retrieving the node!"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("connectivity.cpool", "OConfigurationNode::openNode: caught an exception while retrieving the node! " << exceptionToString(ex)); } return xNode; } diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx index ac234f608016..500a3034ec94 100644 --- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx @@ -32,6 +32,7 @@ #include <file/FDriver.hxx> #include <file/FTable.hxx> #include <comphelper/processfactory.hxx> +#include <tools/diagnose_ex.h> #include <ucbhelper/content.hxx> using namespace com::sun::star::ucb; @@ -147,7 +148,8 @@ namespace } catch( const Exception& ) { - SAL_WARN( "connectivity.drivers", "isCaseSensitiveParentFolder: caught an unexpected exception!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "connectivity.drivers", "isCaseSensitiveParentFolder: caught an unexpected exception! " << exceptionToString(ex) ); } return nIsCS; diff --git a/cui/source/customize/CommandCategoryListBox.cxx b/cui/source/customize/CommandCategoryListBox.cxx index 3908896763b4..7b50dd9a8719 100644 --- a/cui/source/customize/CommandCategoryListBox.cxx +++ b/cui/source/customize/CommandCategoryListBox.cxx @@ -35,6 +35,7 @@ // include search util #include <com/sun/star/util/SearchFlags.hpp> #include <com/sun/star/util/SearchAlgorithms2.hpp> +#include <tools/diagnose_ex.h> #include <unotools/textsearch.hxx> #include <dialmgr.hxx> @@ -331,9 +332,10 @@ void CommandCategoryListBox::categorySelected( const VclPtr<SfxConfigFunctionLi = css::script::browse::theBrowseNodeFactory::get( m_xContext ); rootNode.set( xFac->createView( css::script::browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) ); } - catch( css::uno::Exception& e ) + catch( css::uno::Exception const & ) { - SAL_WARN("cui.customize", "Caught some exception whilst retrieving browse nodes from factory... Exception: " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("cui.customize", "Caught some exception whilst retrieving browse nodes from factory... Exception: " << exceptionToString(ex)); // TODO exception handling } diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 0fd8d4ac7257..d830b2ef8f7e 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -590,17 +590,10 @@ bool MenuSaveInData::Apply() m_aMenuResourceURL, m_xMenuSettings ); } } - catch ( container::NoSuchElementException& ) - { - SAL_WARN("cui.customize", "caught container::NoSuchElementException saving settings"); - } - catch ( css::io::IOException& ) - { - SAL_WARN("cui.customize", "caught IOException saving settings"); - } catch ( css::uno::Exception& ) { - SAL_WARN("cui.customize", "caught some other exception saving settings"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("cui.customize", "caught some other exception saving settings " << exceptionToString(ex)); } SetModified( false ); @@ -2604,17 +2597,10 @@ void ToolbarSaveInData::ApplyToolbar( SvxConfigEntry* pToolbar ) pToolbar->SetParentData( false ); } } - catch ( container::NoSuchElementException& ) - { - SAL_WARN("cui.customize", "caught container::NoSuchElementException saving settings"); - } - catch ( css::io::IOException& ) + catch ( css::uno::Exception const & ) { - SAL_WARN("cui.customize", "caught IOException saving settings"); - } - catch ( css::uno::Exception& ) - { - SAL_WARN("cui.customize", "caught some other exception saving settings"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("cui.customize", "caught exception saving settings " << exceptionToString(ex)); } PersistChanges( GetConfigManager() ); @@ -2637,21 +2623,10 @@ void ToolbarSaveInData::CreateToolbar( SvxConfigEntry* pToolbar ) { GetConfigManager()->insertSettings( pToolbar->GetCommand(), xSettings ); } - catch ( container::ElementExistException& ) - { - SAL_WARN("cui.customize", "caught ElementExistsException saving settings"); - } - catch ( css::lang::IllegalArgumentException& ) - { - SAL_WARN("cui.customize", "caught IOException saving settings"); - } - catch ( css::lang::IllegalAccessException& ) - { - SAL_WARN("cui.customize", "caught IOException saving settings"); - } - catch ( css::uno::Exception& ) + catch ( css::uno::Exception const & ) { - SAL_WARN("cui.customize", "caught some other exception saving settings"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("cui.customize", "caught exception saving settings " << exceptionToString(ex)); } GetEntries()->push_back( pToolbar ); @@ -3363,9 +3338,10 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL ) SAL_WARN("cui.customize", "could not get query XGraphic"); } } - catch( uno::Exception& e ) + catch( uno::Exception const & ) { - SAL_WARN("cui.customize", "Caught exception importing XGraphic: " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("cui.customize", "Caught exception importing XGraphic: " << exceptionToString(ex)); } return result; } diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 83724a28d461..2de38a07edc4 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -55,6 +55,7 @@ #include <svtools/imagemgr.hxx> #include <vcl/treelistentry.hxx> #include <tools/urlobj.hxx> +#include <tools/diagnose_ex.h> #include <vector> #include <algorithm> @@ -659,9 +660,10 @@ IMPL_LINK(SvxScriptOrgDialog, ButtonHdl, weld::Button&, rButton, void) // ISSUE need code to run script here xInv->invoke( "Editable", args, outIndex, outArgs ); } - catch( Exception& e ) + catch( Exception const & ) { - SAL_WARN("cui.dialogs", "Caught exception trying to invoke " << e ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("cui.dialogs", "Caught exception trying to invoke " << exceptionToString(ex) ); } } } @@ -828,9 +830,10 @@ void SvxScriptOrgDialog::createEntry(weld::TreeIter& rEntry) aChildNode = newNode; } - catch( Exception& e ) + catch( Exception const & ) { - SAL_WARN("cui.dialogs", "Caught exception trying to Create " << e ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("cui.dialogs", "Caught exception trying to Create " << exceptionToString(ex) ); } } if ( aChildNode.is() ) @@ -912,9 +915,10 @@ void SvxScriptOrgDialog::renameEntry(weld::TreeIter& rEntry) aChildNode = newNode; } - catch( Exception& e ) + catch( Exception const & ) { - SAL_WARN("cui.dialogs", "Caught exception trying to Rename " << e ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("cui.dialogs", "Caught exception trying to Rename " << exceptionToString(ex) ); } } if ( aChildNode.is() ) @@ -961,9 +965,10 @@ void SvxScriptOrgDialog::deleteEntry(weld::TreeIter& rEntry) aResult = xInv->invoke( "Deletable", args, outIndex, outArgs ); aResult >>= result; // or do we just assume true if no exception ? } - catch( Exception& e ) + catch( Exception const & ) { - SAL_WARN("cui.dialogs", "Caught exception trying to delete " << e ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("cui.dialogs", "Caught exception trying to delete " << exceptionToString(ex) ); } } diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 69b1b82c092d..34f8de7c3f4b 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -45,6 +45,7 @@ #include <vcl/treelistentry.hxx> #include <sfx2/filedlghelper.hxx> #include <sfx2/inputdlg.hxx> +#include <tools/diagnose_ex.h> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -354,9 +355,10 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, StartFolderPickerHdl, void*, void) else if ( xFolderPicker.is() && xFolderPicker->execute() == ExecutableDialogResults::OK ) AddFolder( xFolderPicker->getDirectory() ); } - catch ( Exception& ) + catch ( Exception const & ) { - SAL_WARN( "cui.options", "SvxJavaOptionsPage::StartFolderPickerHdl(): caught exception" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "cui.options", "SvxJavaOptionsPage::StartFolderPickerHdl(): caught exception " << exceptionToString(ex) ); } } diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 1d4f603dec79..eb9aaadf78c1 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -32,6 +32,7 @@ #include <sfx2/sfxuno.hxx> #include <sfx2/dispatch.hxx> #include <tools/urlobj.hxx> +#include <tools/diagnose_ex.h> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> #include <com/sun/star/linguistic2/LinguServiceManager.hpp> @@ -135,7 +136,8 @@ static bool KillFile_Impl( const OUString& rURL ) } catch( ... ) { - SAL_WARN( "cui.options", "KillFile: Any other exception" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "cui.options", "KillFile: Any other exception " << exceptionToString(ex) ); bRet = false; } diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 8e6bc7d2541c..663532701a71 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -629,9 +629,10 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl, Button*, void) ChangeCurrentEntry(sFolder); } } - catch( Exception& ) + catch( Exception const & ) { - SAL_WARN( "cui.options", "SvxPathTabPage::PathHdl_Impl: exception from folder picker" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "cui.options", "SvxPathTabPage::PathHdl_Impl: exception from folder picker " << exceptionToString(ex) ); } } else if (pEntry) diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index e44eb7dbf216..9aabe400d7f8 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -37,6 +37,7 @@ #include <unotools/optionsdlg.hxx> #include <sal/log.hxx> #include <osl/diagnose.h> +#include <tools/diagnose_ex.h> #include <sfx2/fcontnr.hxx> @@ -445,9 +446,10 @@ void SvxSaveTabPage::Reset( const SfxItemSet* ) aDocTypeLB->SelectEntryPos(0); FilterHdl_Impl(*aDocTypeLB); } - catch(Exception& e) + catch(Exception const &) { - SAL_WARN( "cui.options", "exception in FilterFactory access: " << e ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "cui.options", "exception in FilterFactory access: " << exceptionToString(ex) ); } pImpl->bInitialized = true; diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx index 396cf5aaa5b7..33b70f558718 100644 --- a/cui/source/options/optupdt.cxx +++ b/cui/source/options/optupdt.cxx @@ -40,6 +40,7 @@ #include <osl/file.hxx> #include <osl/security.hxx> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> using namespace ::css; @@ -193,7 +194,8 @@ void SvxOnlineUpdateTabPage::UpdateUserAgent() } } } catch (const uno::Exception &) { - SAL_WARN( "cui.options", "Unexpected exception fetching User Agent" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "cui.options", "Unexpected exception fetching User Agent " << exceptionToString(ex) ); } } @@ -410,9 +412,10 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl, Button*, void) UpdateLastCheckedText(); } - catch( const uno::Exception& e ) + catch( const uno::Exception& ) { - SAL_WARN("cui.options", "Caught exception, thread terminated. " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("cui.options", "Caught exception, thread terminated. " << exceptionToString(ex)); } } diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 27f8aa4dcb5e..909150c42465 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -94,6 +94,7 @@ #include <svx/xpool.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/urlobj.hxx> +#include <tools/diagnose_ex.h> #include <unotools/configmgr.hxx> #include <unotools/linguprops.hxx> #include <unotools/misccfg.hxx> @@ -1410,9 +1411,10 @@ static OUString getCurrentFactory_Impl( const Reference< XFrame >& _xFrame ) { SAL_INFO( "cui.options", "unknown module" ); } - catch ( Exception& ) + catch ( Exception const & ) { - SAL_WARN( "cui.options", "getActiveModule_Impl(): exception of XModuleManager::identify()" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "cui.options", "getActiveModule_Impl(): exception of XModuleManager::identify() " << exceptionToString(ex) ); } } @@ -1753,9 +1755,10 @@ OUString OfaTreeOptionsDialog::GetModuleIdentifier( const Reference< XFrame >& r { SAL_INFO( "cui.options", "unknown module" ); } - catch ( Exception& ) + catch ( Exception const & ) { - SAL_WARN( "cui.options", "OfaTreeOptionsDialog::GetModuleIdentifier(): exception of XModuleManager::identify()" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "cui.options", "OfaTreeOptionsDialog::GetModuleIdentifier(): exception of XModuleManager::identify() " << exceptionToString(ex)); } } return sModule; @@ -2111,13 +2114,10 @@ void ExtensionsTabPage::CreateDialogWithHandler() } } } - catch (const css::lang::IllegalArgumentException& e) + catch (const Exception&) { - SAL_WARN("cui.options", "ExtensionsTabPage::CreateDialogWithHandler(): illegal argument:" << e); - } - catch (const Exception& e) - { - SAL_WARN( "cui.options", "ExtensionsTabPage::CreateDialogWithHandler(): exception of XDialogProvider2::createDialogWithHandler(): " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "cui.options", "ExtensionsTabPage::CreateDialogWithHandler(): exception of XDialogProvider2::createDialogWithHandler(): " << exceptionToString(ex)); } } @@ -2131,9 +2131,10 @@ bool ExtensionsTabPage::DispatchAction( const OUString& rAction ) { bRet = m_xEventHdl->callHandlerMethod( m_xPage, Any( rAction ), "external_event" ); } - catch ( Exception& ) + catch ( Exception const & ) { - SAL_WARN( "cui.options", "ExtensionsTabPage::DispatchAction(): exception of XDialogEventHandler::callHandlerMethod()" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "cui.options", "ExtensionsTabPage::DispatchAction(): exception of XDialogEventHandler::callHandlerMethod() " << exceptionToString(ex) ); } } return bRet; diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 5cff9d646dfb..ceb274021843 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1472,9 +1472,10 @@ void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandl { throw; } - catch(Exception&) + catch(Exception const &) { - SAL_WARN("dbaccess", "ORowSet::executeWithCompletion: caught an unexpected exception type while filling in the parameters!"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("dbaccess", "ORowSet::executeWithCompletion: caught an unexpected exception type while filling in the parameters! " << exceptionToString(ex)); } // we're done with the parameters, now for the real execution diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 37cec2057799..ad3713a1f43e 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -1671,9 +1671,10 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r { xProp->setPropertyValue("Version" , uno::makeAny(aVersion)); } - catch (const uno::Exception& e) + catch (const uno::Exception&) { - SAL_WARN("dbaccess", "exception setting Version: " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("dbaccess", "exception setting Version: " << exceptionToString(ex)); } } diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index ead7061ab4b8..f6a3decb4db1 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -691,7 +691,8 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString } catch( const Exception& ) { - SAL_WARN("dbaccess", "ODatabaseSource::buildLowLevelConnection: got a strange exception while analyzing the error!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("dbaccess", "ODatabaseSource::buildLowLevelConnection: got a strange exception while analyzing the error! " << exceptionToString(ex) ); } if ( !xDriver.is() || !xDriver->acceptsURL( m_pImpl->m_sConnectURL ) ) { diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 25049a904e08..47e5c9933a4b 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -203,7 +203,10 @@ SQLExceptionInfo createConnection( const Reference< css::beans::XPropertySet>& catch(const SQLContext& e) { aInfo = SQLExceptionInfo(e); } catch(const SQLWarning& e) { aInfo = SQLExceptionInfo(e); } catch(const SQLException& e) { aInfo = SQLExceptionInfo(e); } - catch(const Exception&) { SAL_WARN("dbaccess.ui", "SbaTableQueryBrowser::OnExpandEntry: could not connect - unknown exception!"); } + catch(const Exception&) { + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("dbaccess.ui", "SbaTableQueryBrowser::OnExpandEntry: could not connect - unknown exception! " << exceptionToString(ex)); + } return aInfo; } 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) ); } } diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx index 0ce287d2a6e4..3a3490ba82b5 100644 --- a/editeng/source/xml/xmltxtexp.cxx +++ b/editeng/source/xml/xmltxtexp.cxx @@ -38,6 +38,7 @@ #include <xmloff/xmlmetae.hxx> #include <cppuhelper/implbase4.hxx> #include <comphelper/processfactory.hxx> +#include <tools/diagnose_ex.h> #include <unotools/streamwrap.hxx> #include <xmloff/xmlexp.hxx> #include <editeng/unoedsrc.hxx> @@ -336,9 +337,10 @@ void SvxWriteXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& } while( false ); } - catch( const uno::Exception& e ) + catch( const uno::Exception& ) { - SAL_WARN("editeng", "exception during xml export: " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("editeng", "exception during xml export: " << exceptionToString(ex)); } } diff --git a/extensions/CppunitTest_extensions_test_update.mk b/extensions/CppunitTest_extensions_test_update.mk index e2cdaf58c315..02876aab74d5 100644 --- a/extensions/CppunitTest_extensions_test_update.mk +++ b/extensions/CppunitTest_extensions_test_update.mk @@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_libraries,extensions_test_update, \ sal \ salhelper \ test \ + tl \ utl \ unotest \ vcl \ diff --git a/extensions/Library_updchk.mk b/extensions/Library_updchk.mk index 269a0d4dd36b..c7f1a54bb65e 100644 --- a/extensions/Library_updchk.mk +++ b/extensions/Library_updchk.mk @@ -23,6 +23,7 @@ $(eval $(call gb_Library_use_libraries,updchk,\ cppu \ sal \ salhelper \ + tl \ utl \ vcl \ )) diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 8f456b889181..af0430e09352 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -174,9 +174,10 @@ static Reference< XNameAccess > getColumns(const Reference< XForm > & _rxForm) if (xSupplyCols.is()) xReturn = xSupplyCols->getColumns(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "extensions.biblio", "::getColumns : caught an exception. " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "extensions.biblio", "::getColumns : caught an exception. " << exceptionToString(ex)); } } diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index 44006083ee29..491eda019fa1 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/form/ListSourceType.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <tools/debug.hxx> +#include <tools/diagnose_ex.h> #include <connectivity/dbtools.hxx> #include <helpids.h> #include <sal/log.hxx> @@ -253,7 +254,8 @@ namespace dbp } catch(const Exception&) { - SAL_WARN( "extensions.dbpilots", "OLinkFieldsPage::initializePage: caught an exception while retrieving the columns!"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "extensions.dbpilots", "OLinkFieldsPage::initializePage: caught an exception while retrieving the columns! " << exceptionToString(ex)); } } return aColumnNames; diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx b/extensions/source/propctrlr/eformspropertyhandler.cxx index d074a7e64fed..31ca06be7121 100644 --- a/extensions/source/propctrlr/eformspropertyhandler.cxx +++ b/extensions/source/propctrlr/eformspropertyhandler.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/inspection/PropertyControlType.hpp> #include <com/sun/star/inspection/XObjectInspectorUI.hpp> #include <tools/debug.hxx> +#include <tools/diagnose_ex.h> #include <sal/log.hxx> #include <functional> @@ -147,8 +148,9 @@ namespace pcr } catch( const Exception& ) { + css::uno::Any ex( cppu::getCaughtException() ); SAL_WARN( "extensions.propctrlr", "EFormsPropertyHandler::getPropertyValue: caught an exception!" - "\n(have been asked for the \"" <<_rPropertyName << "\" property.)"); + "\n(have been asked for the \"" <<_rPropertyName << "\" property.) " << exceptionToString(ex)); } return aReturn; } diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index 47ef6e18093e..4306e073e26b 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -40,6 +40,7 @@ #include <osl/file.hxx> #include <sal/macros.h> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> #ifdef _WIN32 #include <objbase.h> @@ -523,9 +524,10 @@ UpdateCheckThread::run() } } - catch(const uno::Exception& e) { + catch(const uno::Exception&) { + css::uno::Any ex( cppu::getCaughtException() ); // Silently catch all errors - SAL_WARN("extensions.update", "Caught exception, thread terminated. " << e ); + SAL_WARN("extensions.update", "Caught exception, thread terminated. " << exceptionToString(ex) ); } } @@ -538,9 +540,10 @@ ManualUpdateCheckThread::run() runCheck( bExtensionsChecked ); m_aCondition.reset(); } - catch(const uno::Exception& e) { + catch(const uno::Exception&) { // Silently catch all errors - SAL_WARN("extensions.update", "Caught exception, thread terminated. " << e ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("extensions.update", "Caught exception, thread terminated. " << exceptionToString(ex) ); } } diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx index 3e86885fa621..298046485fde 100644 --- a/extensions/source/update/check/updatecheckjob.cxx +++ b/extensions/source/update/check/updatecheckjob.cxx @@ -29,6 +29,7 @@ #include <cppuhelper/implementationentry.hxx> #include <cppuhelper/supportsservice.hxx> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XTerminateListener.hpp> @@ -132,9 +133,10 @@ void SAL_CALL InitUpdateCheckJobThread::run() if ( m_bShowDialog ) aController->showDialog( true ); - } catch (const uno::Exception &e) { + } catch (const uno::Exception &) { + css::uno::Any ex( cppu::getCaughtException() ); // fdo#64962 - don't bring the app down on some unexpected exception. - SAL_WARN("extensions.update", "Caught init update exception, thread terminated. " << e ); + SAL_WARN("extensions.update", "Caught init update exception, thread terminated. " << exceptionToString(ex) ); } } @@ -235,9 +237,10 @@ void UpdateCheckJob::handleExtensionUpdates( const uno::Sequence< beans::NamedVa aController->setUIState( UPDATESTATE_NO_UPDATE_AVAIL, true ); } } - catch( const uno::Exception& e ) + catch( const uno::Exception& ) { - SAL_WARN("extensions.update", "Caught exception, thread terminated. " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("extensions.update", "Caught exception, thread terminated. " << exceptionToString(ex)); } } diff --git a/extensions/source/update/feed/test/updatefeedtest.cxx b/extensions/source/update/feed/test/updatefeedtest.cxx index e443cd1a9473..6e6c944fa70c 100644 --- a/extensions/source/update/feed/test/updatefeedtest.cxx +++ b/extensions/source/update/feed/test/updatefeedtest.cxx @@ -70,9 +70,9 @@ SAL_IMPLEMENT_MAIN() uno::Sequence< uno::Reference< xml::dom::XElement > > theUpdateInfo = rUpdateInformationProvider->getUpdateInformation( theURLs, aExtension ); } - catch( const uno::Exception & e ) + catch( const uno::Exception & ) { - SAL_WARN("extensions.update", "exception caught: " << e); + SAL_WARN("extensions.update", "exception caught: " << exceptionToString(ex)); } catch( ... ) { diff --git a/filter/Library_icg.mk b/filter/Library_icg.mk index 54d733358937..94949bb32904 100644 --- a/filter/Library_icg.mk +++ b/filter/Library_icg.mk @@ -24,7 +24,8 @@ $(eval $(call gb_Library_use_external,icg,boost_headers)) $(eval $(call gb_Library_use_sdk_api,icg)) $(eval $(call gb_Library_use_libraries,icg,\ - comphelper \ + comphelper \ + cppuhelper \ tk \ vcl \ utl \ diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index ba775e98fed8..3004d346522e 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -29,6 +29,7 @@ #include "outact.hxx" #include <memory> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> using namespace ::com::sun::star; @@ -730,9 +731,10 @@ ImportCGM(SvStream& rIn, uno::Reference< frame::XModel > const & rXModel, css::u aXStatInd->end(); } } - catch (const css::uno::Exception& exc) + catch (const css::uno::Exception&) { - SAL_WARN("filter.icgm", exc); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("filter.icgm", exceptionToString(ex)); nStatus = 0; } } diff --git a/filter/source/odfflatxml/OdfFlatXml.cxx b/filter/source/odfflatxml/OdfFlatXml.cxx index db483ffef04b..d4931b1eb848 100644 --- a/filter/source/odfflatxml/OdfFlatXml.cxx +++ b/filter/source/odfflatxml/OdfFlatXml.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/io/XSeekable.hpp> +#include <tools/diagnose_ex.h> using namespace ::cppu; using namespace ::osl; @@ -152,9 +153,10 @@ OdfFlatXml::importer( else saxParser->parseStream(inputSource); } - catch (const Exception &exc) + catch (const Exception &) { - SAL_WARN("filter.odfflatxml", exc); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("filter.odfflatxml", exceptionToString(ex)); return false; } catch (const std::exception &exc) diff --git a/filter/source/xsltfilter/XSLTFilter.cxx b/filter/source/xsltfilter/XSLTFilter.cxx index 3e5164e7af4d..bade0bdbac1a 100644 --- a/filter/source/xsltfilter/XSLTFilter.cxx +++ b/filter/source/xsltfilter/XSLTFilter.cxx @@ -28,6 +28,7 @@ #include <osl/conditn.hxx> #include <rtl/strbuf.hxx> #include <tools/urlobj.hxx> +#include <tools/diagnose_ex.h> #include <sal/log.hxx> #include <comphelper/interaction.hxx> @@ -400,10 +401,11 @@ namespace XSLT m_tcontrol->terminate(); return !m_bError; } - catch( const Exception& exc) + catch( const Exception& ) { + css::uno::Any ex( cppu::getCaughtException() ); // something went wrong - SAL_WARN("filter.xslt", exc); + SAL_WARN("filter.xslt", exceptionToString(ex)); return false; } } diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index e355a18ff24f..77e361b3bf13 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -604,7 +604,8 @@ namespace frm } catch( const Exception& ) { - SAL_WARN( "forms.component", "OComboBoxModel::read: caught an exception while examining the aggregate's string item list!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "forms.component", "OComboBoxModel::read: caught an exception while examining the aggregate's string item list! " << exceptionToString(ex) ); } // Version diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index dd65163908e9..36756bdfeae2 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -1088,7 +1088,8 @@ void SAL_CALL OInterfaceContainer::insertByName(const OUString& _rName, const An } catch( const Exception& ) { - SAL_WARN("forms.misc", "OInterfaceContainer::insertByName: caught an exception!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("forms.misc", "OInterfaceContainer::insertByName: caught an exception! " << exceptionToString(ex) ); } implInsert( m_aItems.size(), xElementProps, true, aElementMetaData.get(), true ); } diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 19d41ee211d7..68120f6bbd51 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -520,9 +520,10 @@ sal_Int32 FormulaDlg_Impl::GetFunctionPos(sal_Int32 nPos) nOldTokPos = nTokPos; } // while ( pIter != pEnd ) } - catch ( const uno::Exception& e ) + catch ( const uno::Exception& ) { - SAL_WARN("formula.ui", "FormulaDlg_Impl::GetFunctionPos exception! " << e.Message); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("formula.ui", "FormulaDlg_Impl::GetFunctionPos exception! " << exceptionToString(ex)); } return nFuncPos; @@ -1018,9 +1019,10 @@ OUString FormulaDlg_Impl::RepairFormula(const OUString& aFormula) } } - catch ( const uno::Exception& e ) + catch ( const uno::Exception& ) { - SAL_WARN("formula.ui", "FormulaDlg_Impl::RepairFormula exception! " << e.Message); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("formula.ui", "FormulaDlg_Impl::RepairFormula exception! " << exceptionToString(ex)); } return aResult; } diff --git a/include/o3tl/deleter.hxx b/include/o3tl/deleter.hxx index 4dce1d005f71..4e90ca5a61f6 100644 --- a/include/o3tl/deleter.hxx +++ b/include/o3tl/deleter.hxx @@ -28,9 +28,9 @@ template<typename T> struct default_delete { delete p; } - catch (const css::uno::Exception& e) + catch (const css::uno::Exception&) { - SAL_WARN("vcl.app", "Fatal exception: " << e.Message); + SAL_WARN("vcl.app", "Fatal exception: " << exceptionToString(ex)); std::terminate(); } catch (const std::exception& e) diff --git a/include/toolkit/helper/macros.hxx b/include/toolkit/helper/macros.hxx index d06988b18fde..cf50d53c15be 100644 --- a/include/toolkit/helper/macros.hxx +++ b/include/toolkit/helper/macros.hxx @@ -103,10 +103,11 @@ void ClassName::disposing( const css::lang::EventObject& ) \ #if OSL_DEBUG_LEVEL > 0 - #define DISPLAY_EXCEPTION( ClassName, MethodName, e ) \ - SAL_WARN( "toolkit", #ClassName "::" #MethodName ": caught an exception! " << e); + #define DISPLAY_EXCEPTION( ClassName, MethodName ) \ + css::uno::Any ex( cppu::getCaughtException() ); \ + SAL_WARN( "toolkit", #ClassName "::" #MethodName ": caught an exception! " << exceptionToString(ex)); #else - #define DISPLAY_EXCEPTION( ClassName, MethodName, e ) (void)e; + #define DISPLAY_EXCEPTION( ClassName, MethodName ) #endif #define IMPL_TABLISTENERMULTIPLEXER_LISTENERMETHOD_BODY_1PARAM( ClassName, InterfaceName, MethodName, ParamType1 ) \ @@ -127,9 +128,9 @@ void ClassName::disposing( const css::lang::EventObject& ) \ if ( e.Context == xListener || !e.Context.is() ) \ aIt.remove(); \ } \ - catch(const css::uno::RuntimeException& e) \ + catch(const css::uno::RuntimeException&) \ { \ - DISPLAY_EXCEPTION( ClassName, MethodName, e ) \ + DISPLAY_EXCEPTION( ClassName, MethodName ) \ } \ } \ } @@ -153,9 +154,9 @@ void ClassName::disposing( const css::lang::EventObject& ) \ if ( e.Context == xListener || !e.Context.is() ) \ aIt.remove(); \ } \ - catch(const css::uno::RuntimeException& e) \ + catch(const css::uno::RuntimeException&) \ { \ - DISPLAY_EXCEPTION( ClassName, MethodName, e ) \ + DISPLAY_EXCEPTION( ClassName, MethodName ) \ } \ } \ } diff --git a/io/Library_io.mk b/io/Library_io.mk index c203daae2e78..8f85ca8b42a8 100644 --- a/io/Library_io.mk +++ b/io/Library_io.mk @@ -17,6 +17,7 @@ $(eval $(call gb_Library_use_libraries,io,\ cppu \ cppuhelper \ sal \ + tl \ )) $(eval $(call gb_Library_set_componentfile,io,io/source/io)) diff --git a/io/source/stm/opump.cxx b/io/source/stm/opump.cxx index 0bcccef819ae..e1b4fe043d5c 100644 --- a/io/source/stm/opump.cxx +++ b/io/source/stm/opump.cxx @@ -41,7 +41,7 @@ #include <cppuhelper/supportsservice.hxx> #include <osl/mutex.hxx> #include <osl/thread.h> - +#include <tools/diagnose_ex.h> using namespace osl; using namespace std; @@ -132,9 +132,10 @@ void Pump::fireError( const Any & exception ) { static_cast< XStreamListener * > ( iter.next() )->error( exception ); } - catch ( const RuntimeException &e ) + catch ( const RuntimeException & ) { - SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << exceptionToString(ex)); } } } @@ -160,9 +161,10 @@ void Pump::fireClose() { static_cast< XStreamListener * > ( iter.next() )->closed( ); } - catch ( const RuntimeException &e ) + catch ( const RuntimeException & ) { - SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << exceptionToString(ex)); } } } @@ -177,9 +179,10 @@ void Pump::fireStarted() { static_cast< XStreamListener * > ( iter.next() )->started( ); } - catch ( const RuntimeException &e ) + catch ( const RuntimeException & ) { - SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << exceptionToString(ex)); } } } @@ -193,9 +196,10 @@ void Pump::fireTerminated() { static_cast< XStreamListener * > ( iter.next() )->terminated(); } - catch ( const RuntimeException &e ) + catch ( const RuntimeException & ) { - SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << exceptionToString(ex)); } } } @@ -293,11 +297,12 @@ void Pump::run() close(); fireClose(); } - catch ( const css::uno::Exception &e ) + catch ( const css::uno::Exception & ) { // we are the last on the stack. // this is to avoid crashing the program, when e.g. a bridge crashes - SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners" << exceptionToString(ex)); } } diff --git a/javaunohelper/Library_juhx.mk b/javaunohelper/Library_juhx.mk index 1a24e5ef54f2..6eacff250c0f 100644 --- a/javaunohelper/Library_juhx.mk +++ b/javaunohelper/Library_juhx.mk @@ -19,6 +19,7 @@ $(eval $(call gb_Library_use_libraries,juhx,\ jvmaccess \ sal \ salhelper \ + tl \ )) $(eval $(call gb_Library_add_exception_objects,juhx,\ diff --git a/javaunohelper/source/bootstrap.cxx b/javaunohelper/source/bootstrap.cxx index cb927de74e9f..442dd00ef2c5 100644 --- a/javaunohelper/source/bootstrap.cxx +++ b/javaunohelper/source/bootstrap.cxx @@ -38,6 +38,7 @@ #include <jni.h> #include <jvmaccess/virtualmachine.hxx> #include <jvmaccess/unovirtualmachine.hxx> +#include <tools/diagnose_ex.h> #include "juhx-export-functions.hxx" #include "vm.hxx" @@ -148,10 +149,11 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap( } catch (const RuntimeException & exc) { + css::uno::Any exAny( cppu::getCaughtException() ); jclass c = jni_env->FindClass( "com/sun/star/uno/RuntimeException" ); if (nullptr != c) { - SAL_WARN("javaunohelper", "forwarding RuntimeException: " << exc ); + SAL_WARN("javaunohelper", "forwarding RuntimeException: " << exceptionToString(exAny) ); OString cstr( OUStringToOString( exc.Message, RTL_TEXTENCODING_JAVA_UTF8 ) ); jni_env->ThrowNew( c, cstr.getStr() ); @@ -159,10 +161,11 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap( } catch (const Exception & exc) { + css::uno::Any ex( cppu::getCaughtException() ); jclass c = jni_env->FindClass( "com/sun/star/uno/Exception" ); if (nullptr != c) { - SAL_WARN("javaunohelper", "forwarding Exception: " << exc ); + SAL_WARN("javaunohelper", "forwarding Exception: " << exceptionToString(ex) ); OString cstr( OUStringToOString( exc.Message, RTL_TEXTENCODING_JAVA_UTF8 ) ); jni_env->ThrowNew( c, cstr.getStr() ); diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index c34d97adf07e..50f1799423d2 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -45,6 +45,7 @@ #include <unotools/lingucfg.hxx> #include <unotools/pathoptions.hxx> #include <unotools/useroptions.hxx> +#include <tools/diagnose_ex.h> #include "convdic.hxx" #include "convdiclist.hxx" @@ -271,7 +272,8 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName ) } catch( ... ) { - SAL_WARN( "linguistic", "HangulHanjaOptionsDialog::OkHdl(): Any other exception" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "linguistic", "HangulHanjaOptionsDialog::OkHdl(): Any other exception " << exceptionToString(ex) ); } } diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 5d27876d6d57..325af32849bd 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -58,6 +58,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> #include <tools/debug.hxx> +#include <tools/diagnose_ex.h> #include <deque> #include <map> @@ -936,10 +937,11 @@ void SAL_CALL GrammarCheckingIterator::processLinguServiceEvent( { throw; } - catch (const ::uno::Exception &rE) + catch (const ::uno::Exception &) { + css::uno::Any ex( cppu::getCaughtException() ); // ignore - SAL_WARN("linguistic", "processLinguServiceEvent: exception: " << rE); + SAL_WARN("linguistic", "processLinguServiceEvent: exception: " << exceptionToString(ex)); } } } @@ -1099,9 +1101,10 @@ void GrammarCheckingIterator::GetConfiguredGCSvcs_Impl() } } } - catch (uno::Exception &) + catch (uno::Exception const &) { - SAL_WARN( "linguistic", "exception caught. Failed to get configured services" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "linguistic", "exception caught. Failed to get configured services " << exceptionToString(ex) ); } { diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx index a3e2bf4948c6..713c5a745b3d 100644 --- a/oox/source/drawingml/textfield.cxx +++ b/oox/source/drawingml/textfield.cxx @@ -33,6 +33,7 @@ #include <oox/core/xmlfilterbase.hxx> #include <drawingml/textparagraphproperties.hxx> #include <drawingml/textcharacterproperties.hxx> +#include <tools/diagnose_ex.h> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -234,7 +235,8 @@ sal_Int32 TextField::insertAt( } catch( const Exception& ) { - SAL_WARN("oox", "OOX: TextField::insertAt() exception"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("oox", "OOX: TextField::insertAt() exception " << exceptionToString(ex)); } return nCharHeight; diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx index 5bcdd262390b..9d80e0517816 100644 --- a/oox/source/drawingml/textrun.cxx +++ b/oox/source/drawingml/textrun.cxx @@ -32,6 +32,7 @@ #include <oox/core/xmlfilterbase.hxx> #include <oox/token/properties.hxx> #include <oox/token/tokens.hxx> +#include <tools/diagnose_ex.h> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::text; @@ -175,7 +176,8 @@ sal_Int32 TextRun::insertAt( } catch( const Exception& ) { - SAL_WARN("oox", "OOX: TextRun::insertAt() exception"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("oox", "OOX: TextRun::insertAt() exception " << exceptionToString(ex)); } return nCharHeight; diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 216cc1982816..2826ca06714e 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -62,6 +62,7 @@ #include <oox/ole/axbinarywriter.hxx> #include <oox/token/properties.hxx> #include <oox/token/tokens.hxx> +#include <tools/diagnose_ex.h> namespace oox { namespace ole { @@ -2742,9 +2743,10 @@ Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl rnCtrlIndex = xFormIC->getCount(); xFormIC->insertByIndex( rnCtrlIndex, Any( xFormComp ) ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN("oox", "exception creating Control: " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("oox", "exception creating Control: " << exceptionToString(ex)); } return xRet; } @@ -2768,9 +2770,10 @@ Reference< XIndexContainer > const & EmbeddedForm::createXForm() mxFormIC.set( xForm, UNO_QUERY_THROW ); } } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN("oox", "exception creating Form: " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("oox", "exception creating Form: " << exceptionToString(ex)); } // always clear the forms supplier to not try to create the form again mxFormsSupp.clear(); diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 012ca342ae77..6fa26118f246 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -305,9 +305,10 @@ Reference< XShape > Drawing::createAndInsertXControlShape( const ::oox::ole::Emb // set the control model at the shape Reference< XControlShape >( xShape, UNO_QUERY_THROW )->setControl( xCtrlModel ); } - catch (Exception const& e) + catch (Exception const&) { - SAL_WARN("oox", "exception inserting Shape: " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("oox", "exception inserting Shape: " << exceptionToString(ex)); } return xShape; } diff --git a/sax/Library_expwrap.mk b/sax/Library_expwrap.mk index 076814aab0e8..17a91e4d5904 100644 --- a/sax/Library_expwrap.mk +++ b/sax/Library_expwrap.mk @@ -36,6 +36,7 @@ $(eval $(call gb_Library_use_libraries,expwrap,\ sal \ salhelper \ sax \ + tl \ )) $(eval $(call gb_Library_add_exception_objects,expwrap,\ diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 1e8b578e325f..6d888f2d1115 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -39,6 +39,7 @@ #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> #include <salhelper/thread.hxx> +#include <tools/diagnose_ex.h> #include <queue> #include <memory> @@ -610,8 +611,7 @@ void Entity::saveException( const Any & e ) // fdo#81214 - allow the parser to run on after an exception, // unexpectedly some 'startElements' produce an UNO_QUERY_THROW // for XComponent; and yet expect to continue parsing. - SAL_WARN("sax", "Unexpected exception from XML parser " - << e.get<Exception>()); + SAL_WARN("sax", "Unexpected exception from XML parser " << exceptionToString(e)); osl::MutexGuard g(maSavedExceptionMutex); if (maSavedException.hasValue()) { diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index 1c2ab97f3a1e..5b9637d50607 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -42,7 +42,7 @@ #include <com/sun/star/sheet/XMembersSupplier.hpp> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/util/XCloneable.hpp> - +#include <tools/diagnose_ex.h> #include <unordered_map> #include <algorithm> @@ -1142,9 +1142,10 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie SC_UNO_DP_ROWGRAND, static_cast<bool>(nRowGrandMode) ); } } - catch(uno::Exception&) + catch(uno::Exception const &) { - SAL_WARN("sc.core", "exception in WriteToSource"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("sc.core", "exception in WriteToSource " << exceptionToString(ex)); } } diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index 2546bf98ba46..b3ec268b0db9 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -38,6 +38,7 @@ #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <tools/urlobj.hxx> +#include <tools/diagnose_ex.h> namespace oox { namespace xls { @@ -94,9 +95,10 @@ bool ExcelFilter::importDocument() { importDocumentProperties(); } - catch( const Exception& e ) + catch( const Exception& ) { - SAL_WARN("sc", "exception when importing document properties " << e); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("sc", "exception when importing document properties " << exceptionToString(ex)); } catch( ... ) { diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx index 2adda9081355..a4f033510e6f 100644 --- a/sc/source/filter/oox/pivotcachebuffer.cxx +++ b/sc/source/filter/oox/pivotcachebuffer.cxx @@ -35,6 +35,7 @@ #include <oox/token/namespaces.hxx> #include <oox/token/properties.hxx> #include <oox/token/tokens.hxx> +#include <tools/diagnose_ex.h> #include <defnamesbuffer.hxx> #include <pivotcachefragment.hxx> #include <sheetdatabuffer.hxx> @@ -734,9 +735,10 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie aAutoName = xGroupName->getName(); } } - catch( Exception& ) + catch( Exception const & ) { - SAL_WARN("sc", "PivotCacheField::createParentGroupField - exception was thrown" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("sc", "PivotCacheField::createParentGroupField - exception was thrown " << exceptionToString(ex) ); } SAL_WARN_IF( aAutoName.isEmpty(), "sc", "PivotCacheField::createParentGroupField - cannot find auto-generated group name" ); @@ -762,9 +764,10 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie pName->maGroupName = aGroupName; } } - catch( Exception& ) + catch( Exception const & ) { - SAL_WARN("sc", "PivotCacheField::createParentGroupField - exception was thrown" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("sc", "PivotCacheField::createParentGroupField - exception was thrown " << exceptionToString(ex) ); } } ++nIndex; diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index a377239ccd11..8de761208428 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -58,6 +58,7 @@ #include <svx/xmleohlp.hxx> #include <sal/log.hxx> #include <unotools/saveopt.hxx> +#include <tools/diagnose_ex.h> #include <document.hxx> #include <xmlwrap.hxx> @@ -193,6 +194,7 @@ ErrCode ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCompo } 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); @@ -214,7 +216,7 @@ ErrCode ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCompo nReturn = ERRCODE_SFX_WRONGPASSWORD; else { - SAL_WARN("sc.filter", "SAX parse exception caught while importing: " << r); + SAL_WARN("sc.filter", "SAX parse exception caught while importing: " << exceptionToString(ex)); OUString sErr = OUString::number( r.LineNumber ) + "," + @@ -238,6 +240,7 @@ ErrCode ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCompo } catch( const xml::sax::SAXException& r ) { + css::uno::Any ex( cppu::getCaughtException() ); packages::zip::ZipIOException aBrokenPackage; if ( r.WrappedException >>= aBrokenPackage ) return ERRCODE_IO_BROKENPACKAGE; @@ -245,26 +248,29 @@ ErrCode ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCompo nReturn = ERRCODE_SFX_WRONGPASSWORD; else { - SAL_WARN("sc.filter", "SAX exception caught while importing: " << r); + SAL_WARN("sc.filter", "SAX exception caught while importing: " << exceptionToString(ex)); nReturn = SCERR_IMPORT_FORMAT; } } - catch( const packages::zip::ZipIOException& r ) + catch( const packages::zip::ZipIOException& ) { - SAL_WARN("sc.filter", "Zip exception caught while importing: " << r); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("sc.filter", "Zip exception caught while importing: " << exceptionToString(ex)); nReturn = ERRCODE_IO_BROKENPACKAGE; } - catch( const io::IOException& r ) + catch( const io::IOException& ) { - SAL_WARN("sc.filter", "IO exception caught while importing: " << r); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("sc.filter", "IO exception caught while importing: " << exceptionToString(ex)); nReturn = SCERR_IMPORT_OPEN; } - catch( const uno::Exception& r ) + catch( const uno::Exception& ) { - SAL_WARN("sc.filter", "uno exception caught while importing: " << r); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("sc.filter", "uno exception caught while importing: " << exceptionToString(ex)); nReturn = SCERR_IMPORT_UNKNOWN; } diff --git a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx index 4d1b654d9049..61bf52b466f5 100644 --- a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx +++ b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx @@ -21,6 +21,7 @@ #include <sal/log.hxx> #include <svx/svdmodel.hxx> #include <svx/unomod.hxx> +#include <tools/diagnose_ex.h> using namespace ::com::sun::star; @@ -67,9 +68,10 @@ void ScDrawModelBroadcaster::Notify( SfxBroadcaster&, { xListener->notifyEvent( aEvent ); } - catch( const uno::RuntimeException& r ) + catch( const uno::RuntimeException& ) { - SAL_WARN("sc.ui", "Runtime exception caught while notifying shape. : " << r); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("sc.ui", "Runtime exception caught while notifying shape. : " << exceptionToString(ex)); } } } 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(); diff --git a/sdext/source/minimizer/configurationaccess.cxx b/sdext/source/minimizer/configurationaccess.cxx index f0e16bd12461..a711610bc0aa 100644 --- a/sdext/source/minimizer/configurationaccess.cxx +++ b/sdext/source/minimizer/configurationaccess.cxx @@ -28,6 +28,7 @@ #include <comphelper/propertysequence.hxx> #include <sal/macros.h> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -328,10 +329,11 @@ Reference< XInterface > ConfigurationAccess::GetConfigurationNode( } } } - catch (const Exception& rException) + catch (const Exception&) { + css::uno::Any ex( cppu::getCaughtException() ); SAL_WARN("sdext.minimizer", "caught exception while getting configuration node " - << sPathToNode << " : " << rException); + << sPathToNode << " : " << exceptionToString(ex)); } return xNode; } diff --git a/sdext/source/presenter/PresenterConfigurationAccess.cxx b/sdext/source/presenter/PresenterConfigurationAccess.cxx index f2c5569a4dec..58fc6a6d058f 100644 --- a/sdext/source/presenter/PresenterConfigurationAccess.cxx +++ b/sdext/source/presenter/PresenterConfigurationAccess.cxx @@ -149,9 +149,10 @@ Any PresenterConfigurationAccess::GetConfigurationNode ( return rxNode->getByHierarchicalName(sPathToNode); } } - catch (const Exception& rException) + catch (const Exception&) { - SAL_WARN("sdext.presenter", "caught exception while getting configuration node " << sPathToNode << " : " << rException); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("sdext.presenter", "caught exception while getting configuration node " << sPathToNode << " : " << exceptionToString(ex)); } return Any(); diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx index eb995dd935b3..59350c34f3fa 100644 --- a/sdext/source/presenter/PresenterTextView.cxx +++ b/sdext/source/presenter/PresenterTextView.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/TextDirection.hpp> #include <com/sun/star/text/WritingMode2.hpp> +#include <tools/diagnose_ex.h> using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; @@ -1061,7 +1062,8 @@ PresenterTextCaret::~PresenterTextCaret() } catch (uno::Exception const&) { - SAL_WARN("sdext.presenter", "unexpected exception in ~PresenterTextCaret"); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN("sdext.presenter", "unexpected exception in ~PresenterTextCaret " << exceptionToString(ex)); } } diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 261ef18a1fa3..ac556afa7f42 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -93,21 +93,10 @@ namespace ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); bRet = aCnt.isDocument(); } - catch( const ucb::CommandAbortedException& ) - { - SAL_INFO( "sfx.appl", "CommandAbortedException" ); - } - catch( const ucb::IllegalIdentifierException& ) - { - SAL_INFO( "sfx.appl", "IllegalIdentifierException" ); - } - catch( const ucb::ContentCreationException& ) - { - SAL_INFO( "sfx.appl", "IllegalIdentifierException" ); - } catch( const uno::Exception& ) { - SAL_WARN( "sfx.appl", "Any other exception" ); + css::uno::Any ex = cppu::getCaughtException(); + SAL_WARN( "sfx.appl", exceptionToString(ex) ); } return bRet; diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index c972a4bfd301..314a9587a69f 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1393,7 +1393,8 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) } catch( const css::uno::Exception& ) { - SAL_WARN( "sfx.appl", "SfxApplication::OfaExec_Impl(SID_MORE_DICTIONARIES): caught an exception!" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "sfx.appl", "SfxApplication::OfaExec_Impl(SID_MORE_DICTIONARIES): caught an exception " << exceptionToString(ex) ); } break; } diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index d4e774b1f775..1e643918361e 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -33,6 +33,7 @@ #include <sal/log.hxx> #include <osl/diagnose.h> #include <tools/debug.hxx> +#include <tools/diagnose_ex.h> #include <sfx2/strings.hrc> #include <helpids.h> @@ -2030,9 +2031,10 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox() Any aAny = ConfigurationHelper::readRelativeKey( xConfiguration, sPath, KEY_UI_NAME ); aAny >>= sTemp; } - catch( Exception& ) + catch( Exception const & ) { - SAL_WARN( "sfx.appl", "SfxHelpTextWindow_Impl::InitOnStartupBox(): unexpected exception" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "sfx.appl", "SfxHelpTextWindow_Impl::InitOnStartupBox(): unexpected exception " << exceptionToString(ex) ); } sModuleName = sTemp; } @@ -2283,9 +2285,10 @@ IMPL_LINK( SfxHelpTextWindow_Impl, CheckHdl, Button*, pButton, void ) xConfiguration, PATH_OFFICE_FACTORIES + sCurrentFactory, KEY_HELP_ON_OPEN, makeAny( bChecked ) ); ConfigurationHelper::flush( xConfiguration ); } - catch( Exception& ) + catch( Exception const & ) { - SAL_WARN( "sfx.appl", "SfxHelpTextWindow_Impl::CheckHdl(): unexpected exception" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "sfx.appl", "SfxHelpTextWindow_Impl::CheckHdl(): unexpected exception " << exceptionToString(ex) ); } } @@ -2439,9 +2442,10 @@ void SfxHelpTextWindow_Impl::GetFocus() xWindow->setFocus(); } } - catch( Exception& ) + catch( Exception const & ) { - SAL_WARN( "sfx.appl", "SfxHelpTextWindow_Impl::GetFocus(): unexpected exception" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "sfx.appl", "SfxHelpTextWindow_Impl::GetFocus(): unexpected exception " << exceptionToString(ex) ); } } @@ -2526,9 +2530,10 @@ void SfxHelpTextWindow_Impl::SetPageStyleHeaderOff() const } } } - catch( Exception& ) + catch( Exception const & ) { - SAL_WARN( "sfx.appl", "SfxHelpTextWindow_Impl::SetPageStyleHeaderOff(): unexpected exception" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "sfx.appl", "SfxHelpTextWindow_Impl::SetPageStyleHeaderOff(): unexpected exception " << exceptionToString(ex) ); } SAL_WARN_IF( !bSetOff, "sfx.appl", "SfxHelpTextWindow_Impl::SetPageStyleHeaderOff(): set off failed" ); @@ -3098,9 +3103,10 @@ void SfxHelpWindow_Impl::CloseWindow() xCloser->close( false ); } } - catch( Exception& ) + catch( Exception const & ) { - SAL_WARN( "sfx.appl", "SfxHelpWindow_Impl::CloseWindow(): caught an exception" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "sfx.appl", "SfxHelpWindow_Impl::CloseWindow(): caught an exception " << exceptionToString(ex) ); } } diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 80d521b39a47..f305c3a04ee6 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -83,6 +83,7 @@ #include <sfx2/frame.hxx> #include <rtl/string.hxx> #include <svtools/langtab.hxx> +#include <tools/diagnose_ex.h> using namespace ::com::sun::star::beans; using namespace ::com::sun::star::frame; @@ -399,7 +400,8 @@ static OUString getCurrentModuleIdentifier_Impl() } catch (const Exception&) { - SAL_WARN( "sfx.appl", "SfxHelp::getCurrentModuleIdentifier_Impl(): exception of XModuleManager::identify()" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "sfx.appl", "SfxHelp::getCurrentModuleIdentifier_Impl(): exception of XModuleManager::identify() " << exceptionToString(ex) ); } } @@ -480,7 +482,8 @@ OUString SfxHelp::GetHelpModuleName_Impl(const OUString& rHelpID) } catch (const Exception&) { - SAL_WARN( "sfx.appl", "SfxHelp::GetHelpModuleName_Impl(): exception of XNameAccess::getByName()" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "sfx.appl", "SfxHelp::GetHelpModuleName_Impl(): " << exceptionToString(ex) ); } } } diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index 2cc201acface..6588834a3096 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -38,7 +38,7 @@ #include <unotools/localedatawrapper.hxx> #include <rtl/strbuf.hxx> #include <sal/log.hxx> - +#include <tools/diagnose_ex.h> #include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <tools/datetime.hxx> @@ -76,13 +76,10 @@ std::vector<OUString> SfxContentHelper::GetResultSet( const OUString& rURL ) if ( xDynResultSet.is() ) xResultSet = xDynResultSet->getStaticResultSet(); } - catch( const ucb::CommandAbortedException& ) - { - SAL_WARN( "sfx.bastyp", "GetResultSet: CommandAbortedException" ); - } catch( const uno::Exception& ) { - SAL_WARN( "sfx.bastyp", "GetResultSet: Any other exception" ); + css::uno::Any ex( cppu::getCaughtException() ); + SAL_WARN( "sfx.bastyp", "GetResultSet: " << exceptionToString(ex) ); } ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits