desktop/Library_offacc.mk | 1 desktop/source/app/app.cxx | 25 ++++------ desktop/source/app/appinit.cxx | 5 +- desktop/source/app/dispatchwatcher.cxx | 22 ++++---- desktop/source/app/langselect.cxx | 9 ++- desktop/source/app/opencl.cxx | 5 +- desktop/source/app/userinstall.cxx | 5 +- desktop/source/deployment/manager/dp_informationprovider.cxx | 9 ++- desktop/source/deployment/manager/dp_manager.cxx | 8 +-- desktop/source/deployment/registry/component/dp_component.cxx | 10 ++-- desktop/source/deployment/registry/dp_backend.cxx | 5 +- desktop/source/deployment/registry/package/dp_package.cxx | 5 -- desktop/source/lib/init.cxx | 2 desktop/source/migration/migration.cxx | 24 ++++----- desktop/source/migration/services/oo3extensionmigration.cxx | 8 +-- desktop/source/offacc/acceptor.cxx | 5 +- editeng/source/editeng/impedit2.cxx | 5 +- editeng/source/misc/svxacorr.cxx | 5 +- embeddedobj/source/msole/oleembed.cxx | 5 +- embeddedobj/source/msole/ownview.cxx | 5 +- extensions/source/bibliography/datman.cxx | 6 -- 21 files changed, 89 insertions(+), 85 deletions(-)
New commits: commit 2c251422bf58449c57ca15527960dc9528b330ea Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Jun 14 15:30:08 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jun 15 12:25:41 2019 +0200 loplugin:logexceptionnicely in editeng..extensions Change-Id: I50b9d7e92ef057c985d0d6e76dfeb62591d404f6 Reviewed-on: https://gerrit.libreoffice.org/74047 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 472a3d78de14..eda0c2c0f374 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -61,6 +61,7 @@ #include <sot/formats.hxx> #include <svl/asiancfg.hxx> #include <i18nutil/unicode.hxx> +#include <tools/diagnose_ex.h> #include <comphelper/lok.hxx> #include <unotools/configmgr.hxx> @@ -3542,9 +3543,9 @@ EditSelection ImpEditEngine::PasteText( uno::Reference< datatransfer::XTransfera } bDone = true; } - catch( const css::uno::Exception& e) + catch( const css::uno::Exception&) { - SAL_WARN( "editeng", "Unable to paste EDITENGINE_ODF_TEXT_FLAT " << e ); + TOOLS_WARN_EXCEPTION( "editeng", "Unable to paste EDITENGINE_ODF_TEXT_FLAT" ); } } diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 01a4f27234fb..2a7db090d1ed 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -75,6 +75,7 @@ #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/ucb/TransferInfo.hpp> #include <com/sun/star/ucb/NameClash.hpp> +#include <tools/diagnose_ex.h> #include <xmloff/xmltoken.hxx> #include <vcl/help.hxx> #include <set> @@ -2275,9 +2276,9 @@ SvStringsISortDtor* SvxAutoCorrectLanguageLists::LoadWrdSttExceptList() if( xStg.is() && xStg->IsContained( sTemp ) ) LoadXMLExceptList_Imp( pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg ); } - catch (const css::ucb::ContentCreationException &e) + catch (const css::ucb::ContentCreationException &) { - SAL_WARN("editeng", "SvxAutoCorrectLanguageLists::LoadWrdSttExceptList: Caught " << e); + TOOLS_WARN_EXCEPTION("editeng", "SvxAutoCorrectLanguageLists::LoadWrdSttExceptList"); } return pWrdStt_ExcptLst.get(); } diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index beeae8ab2469..6dd539bd7a8e 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -49,6 +49,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/mimeconfighelper.hxx> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> #include <targetstatecontrol.hxx> @@ -934,9 +935,9 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID ) { throw; } - catch (uno::Exception const& e) + catch (uno::Exception const&) { - SAL_WARN("embeddedobj.ole", "OleEmbeddedObject::doVerb: -9 fallback path: " << e); + TOOLS_WARN_EXCEPTION("embeddedobj.ole", "OleEmbeddedObject::doVerb: -9 fallback path:"); } } diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx index 0685bba77a37..e89ec59f60d8 100644 --- a/embeddedobj/source/msole/ownview.cxx +++ b/embeddedobj/source/msole/ownview.cxx @@ -41,6 +41,7 @@ #include <comphelper/storagehelper.hxx> #include <comphelper/mimeconfighelper.hxx> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> #include "olepersist.hxx" #include "ownview.hxx" @@ -150,9 +151,9 @@ bool OwnView_Impl::CreateModelFromURL( const OUString& aFileURL ) } } } - catch (uno::Exception const& e) + catch (uno::Exception const&) { - SAL_WARN("embeddedobj.ole", "OwnView_Impl::CreateModelFromURL:" << e); + TOOLS_WARN_EXCEPTION("embeddedobj.ole", "OwnView_Impl::CreateModelFromURL:"); } } diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index ad8215500d9a..0345049a9238 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -426,11 +426,9 @@ DBChangeDialog_Impl::DBChangeDialog_Impl(weld::Window* pParent, BibDataManager* m_xSelectionLB->append_text(rSourceName); m_xSelectionLB->select_text(sActiveSource); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN("extensions.biblio", - "Exception in BibDataManager::DBChangeDialog_Impl::DBChangeDialog_Impl " - << e); + TOOLS_WARN_EXCEPTION("extensions.biblio", ""); } } commit 1b75f95f9bfa2f4f5ddd4c6b2ef6c86576d9c92b Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Jun 14 15:29:26 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jun 15 12:25:22 2019 +0200 loplugin:logexceptionnicely in desktop Change-Id: I19f70b0e9d1ca2bbcd2595af24f2e15766d14b33 Reviewed-on: https://gerrit.libreoffice.org/74046 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/desktop/Library_offacc.mk b/desktop/Library_offacc.mk index e02946b76692..b50dd4441dce 100644 --- a/desktop/Library_offacc.mk +++ b/desktop/Library_offacc.mk @@ -16,6 +16,7 @@ $(eval $(call gb_Library_use_libraries,offacc,\ cppu \ cppuhelper \ sal \ + tl \ )) $(eval $(call gb_Library_set_componentfile,offacc,desktop/source/offacc/offacc)) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 3874b39270e5..bda1df98f6da 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -305,8 +305,8 @@ void SetRestartState() { comphelper::ConfigurationChanges::create()); officecfg::Setup::Office::OfficeRestartInProgress::set(true, batch); batch->commit(); - } catch (css::uno::Exception & e) { - SAL_WARN("desktop.app", "ignoring " << e); + } catch (css::uno::Exception) { + TOOLS_WARN_EXCEPTION("desktop.app", "ignoring"); } } @@ -323,9 +323,8 @@ void DoRestartActionsIfNecessary(bool quickstart) { comphelper::getProcessComponentContext(), shouldLaunchQuickstart()); } - } catch (css::uno::Exception & e) { - SAL_WARN( - "desktop.app", "ignoring " << e); + } catch (css::uno::Exception &) { + TOOLS_WARN_EXCEPTION("desktop.app", "ignoring"); } } } @@ -2023,9 +2022,9 @@ void Desktop::OpenClients() xRecovery->dispatch(aCmd, css::uno::Sequence< css::beans::PropertyValue >()); } - catch(const css::uno::Exception& e) + catch(const css::uno::Exception&) { - SAL_WARN( "desktop.app", "Could not disable AutoRecovery." << e); + TOOLS_WARN_EXCEPTION( "desktop.app", "Could not disable AutoRecovery."); } } else @@ -2052,9 +2051,9 @@ void Desktop::OpenClients() false , // false => force recovery instead of emergency save bExistsRecoveryData); } - catch(const css::uno::Exception& e) + catch(const css::uno::Exception&) { - SAL_WARN( "desktop.app", "Error during recovery" << e); + TOOLS_WARN_EXCEPTION( "desktop.app", "Error during recovery"); } } @@ -2066,9 +2065,9 @@ void Desktop::OpenClients() xSessionListener = SessionListener::createWithOnQuitFlag( ::comphelper::getProcessComponentContext(), bUIOnSessionShutdownAllowed); } - catch(const css::uno::Exception& e) + catch(const css::uno::Exception&) { - SAL_WARN( "desktop.app", "Registration of session listener failed" << e); + TOOLS_WARN_EXCEPTION( "desktop.app", "Registration of session listener failed"); } if ( !bExistsRecoveryData && xSessionListener.is() ) @@ -2078,9 +2077,9 @@ void Desktop::OpenClients() { xSessionListener->doRestore(); } - catch(const css::uno::Exception& e) + catch(const css::uno::Exception&) { - SAL_WARN( "desktop.app", "Error in session management" << e); + TOOLS_WARN_EXCEPTION( "desktop.app", "Error in session management"); } } } diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 2363b36722f0..642733efceb2 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -44,6 +44,7 @@ #include <rtl/ustrbuf.hxx> #include <rtl/bootstrap.hxx> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> #include <rtl/instance.hxx> #include <comphelper/processfactory.hxx> @@ -159,11 +160,11 @@ void Desktop::createAcceptor(const OUString& aAcceptString) rAcceptor->initialize( aSeq ); rMap.emplace(aAcceptString, rAcceptor); } - catch (const css::uno::Exception& e) + catch (const css::uno::Exception&) { // no error handling needed... // acceptor just won't come up - SAL_WARN( "desktop.app", "Acceptor could not be created: " << e); + TOOLS_WARN_EXCEPTION( "desktop.app", "Acceptor could not be created"); } } else diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 37fe079d18dc..96f0a7f69168 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -55,6 +55,7 @@ #include <com/sun/star/document/XEmbeddedScripts.hpp> #include <comphelper/sequence.hxx> +#include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> #include <unotools/mediadescriptor.hxx> #include <unotools/tempfile.hxx> @@ -446,12 +447,11 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest else xDispatcher->dispatch( aURL, aArgs2 ); } - catch (const css::uno::Exception& e) + catch (const css::uno::Exception&) { - SAL_WARN( + TOOLS_WARN_EXCEPTION( "desktop.app", - "Desktop::OpenDefault() ignoring Exception while" - " calling XNotifyingDispatch: " << e); + "Desktop::OpenDefault() ignoring Exception while calling XNotifyingDispatch"); } } } @@ -503,19 +503,17 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest xDesktop, aName, aTarget, comphelper::containerToSequence(aArgs)), UNO_QUERY); } - catch (const css::lang::IllegalArgumentException& iae) + catch (const css::lang::IllegalArgumentException&) { - SAL_WARN( + TOOLS_WARN_EXCEPTION( "desktop.app", - "Dispatchwatcher IllegalArgumentException while calling" - " loadComponentFromURL: " << iae); + "Dispatchwatcher IllegalArgumentException while calling loadComponentFromURL"); } - catch (const css::io::IOException& ioe) + catch (const css::io::IOException&) { - SAL_WARN( + TOOLS_WARN_EXCEPTION( "desktop.app", - "Dispatchwatcher IOException while calling" - " loadComponentFromURL: " << ioe); + "Dispatchwatcher IOException while calling loadComponentFromURL"); } if ( aDispatchRequest.aRequestType == REQUEST_OPEN || aDispatchRequest.aRequestType == REQUEST_VIEW || diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx index 86ce7434e6ab..57f7d3831ff9 100644 --- a/desktop/source/app/langselect.cxx +++ b/desktop/source/app/langselect.cxx @@ -38,6 +38,7 @@ #include <sal/types.h> #include <svl/languageoptions.hxx> #include <svtools/langhelp.hxx> +#include <tools/diagnose_ex.h> #include <app.hxx> @@ -90,8 +91,8 @@ bool prepareLocale() { officecfg::Office::Linguistic::General::UILocale::set( "", batch); batch->commit(); - } catch (css::uno::Exception & e) { - SAL_WARN("desktop.app", "ignoring " << e); + } catch (const css::uno::Exception &) { + TOOLS_WARN_EXCEPTION("desktop.app", "ignoring"); } } } @@ -123,8 +124,8 @@ bool prepareLocale() { comphelper::ConfigurationChanges::create()); officecfg::Setup::L10N::ooLocale::set(locale, batch); batch->commit(); - } catch (css::uno::Exception & e) { - SAL_WARN("desktop.app", "ignoring " << e); + } catch (const css::uno::Exception &) { + TOOLS_WARN_EXCEPTION("desktop.app", "ignoring"); } } MsLangId::setConfiguredSystemUILanguage(tag.getLanguageType(false)); diff --git a/desktop/source/app/opencl.cxx b/desktop/source/app/opencl.cxx index 92d720eeae9f..16da10e50206 100644 --- a/desktop/source/app/opencl.cxx +++ b/desktop/source/app/opencl.cxx @@ -25,6 +25,7 @@ #include <officecfg/Office/Common.hxx> #include <svl/documentlockfile.hxx> +#include <tools/diagnose_ex.h> #include <com/sun/star/table/XCell2.hpp> #include <com/sun/star/sheet/XCalculatable.hpp> @@ -162,9 +163,9 @@ static bool testOpenCLCompute(const Reference< XDesktop2 > &xDesktop, const OUSt bSuccess = true; } } - catch (const css::uno::Exception &e) + catch (const css::uno::Exception &) { - SAL_WARN("opencl", "OpenCL testing failed - disabling: " << e); + TOOLS_WARN_EXCEPTION("opencl", "OpenCL testing failed - disabling"); } if (nKernelFailures != openclwrapper::kernelFailures) diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx index 2fa7f5befa69..55c5a6fa01b0 100644 --- a/desktop/source/app/userinstall.cxx +++ b/desktop/source/app/userinstall.cxx @@ -30,6 +30,7 @@ #include <rtl/bootstrap.hxx> #include <rtl/ustring.hxx> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> #include <unotools/bootstrap.hxx> #include "userinstall.hxx" @@ -146,8 +147,8 @@ Status create(OUString const & uri) { bool isCreated() { try { return officecfg::Setup::Office::ooSetupInstCompleted::get(); - } catch (css::uno::Exception & e) { - SAL_WARN("desktop.app", "ignoring " << e); + } catch (const css::uno::Exception &) { + TOOLS_WARN_EXCEPTION("desktop.app", "ignoring"); return false; } } diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx index caa1d2b7d8bb..5eafb605c91a 100644 --- a/desktop/source/deployment/manager/dp_informationprovider.cxx +++ b/desktop/source/deployment/manager/dp_informationprovider.cxx @@ -39,6 +39,7 @@ #include <osl/diagnose.h> #include <sal/log.hxx> #include <rtl/ustring.hxx> +#include <tools/diagnose_ex.h> #include <ucbhelper/content.hxx> #include <dp_dependencies.hxx> @@ -144,9 +145,9 @@ PackageInformationProvider::getPackageLocation( const OUString& _sExtensionId ) ::ucbhelper::Content aContent( aLocationURL, nullptr, mxContext ); aLocationURL = aContent.getURL(); } - catch (const css::ucb::ContentCreationException& e) + catch (const css::ucb::ContentCreationException&) { - SAL_WARN("desktop.deployment", "ignoring " << e); + TOOLS_WARN_EXCEPTION("desktop.deployment", "ignoring"); } } return aLocationURL; @@ -215,8 +216,8 @@ PackageInformationProvider::isUpdateAvailable( const OUString& _sExtensionId ) extensions = extMgr->getExtensionsWithSameIdentifier( dp_misc::getIdentifier(info.extension), info.extension->getName(), uno::Reference<css_ucb::XCommandEnvironment>()); - } catch (const lang::IllegalArgumentException& e) { - SAL_WARN("desktop.deployment", "ignoring " << e); + } catch (const lang::IllegalArgumentException&) { + TOOLS_WARN_EXCEPTION("desktop.deployment", "ignoring"); continue; } OSL_ASSERT(extensions.getLength() == 3); diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 603fb254acee..78473d35bff9 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -1279,9 +1279,9 @@ bool PackageManagerImpl::synchronizeRemovedExtensions( bModified = true; } } - catch( const uno::Exception & e ) + catch( const uno::Exception & ) { - SAL_WARN("desktop.deployment", e); + TOOLS_WARN_EXCEPTION("desktop.deployment", ""); } } return bModified; @@ -1416,10 +1416,10 @@ bool PackageManagerImpl::synchronizeAddedExtensions( } } } - catch (const uno::Exception & e) + catch (const uno::Exception &) { // Looks like exceptions being caught here is not an uncommon case. - SAL_WARN("desktop.deployment", e); + TOOLS_WARN_EXCEPTION("desktop.deployment", ""); } } return bModified; diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index 7167d2d1748a..98ff6a52a888 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -35,6 +35,7 @@ #include <comphelper/sequence.hxx> #include <xmlscript/xml_helper.hxx> #include <svl/inettype.hxx> +#include <tools/diagnose_ex.h> #include <com/sun/star/deployment/DeploymentException.hpp> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <com/sun/star/container/XNameContainer.hpp> @@ -1373,13 +1374,12 @@ void BackendImpl::ComponentPackageImpl::processPackage_( if (!startup) { try { componentLiveInsertion(data, factories); - } catch (css::uno::Exception & e) { - SAL_INFO( - "desktop.deployment", "caught " << e); + } catch (css::uno::Exception &) { + TOOLS_INFO_EXCEPTION("desktop.deployment", "caught"); try { impreg->revokeImplementation(url, rdb); - } catch (css::uno::RuntimeException & e2) { - SAL_WARN("desktop.deployment", "ignored " << e2); + } catch (css::uno::RuntimeException &) { + TOOLS_WARN_EXCEPTION("desktop.deployment", "ignored"); } throw; } diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 58049f46e9b9..23b61e3cf1e1 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -44,6 +44,7 @@ #include <com/sun/star/beans/StringPair.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdbc/XRow.hpp> +#include <tools/diagnose_ex.h> #include <unotools/tempfile.hxx> #include <boost/optional.hpp> @@ -647,8 +648,8 @@ void Package::processPackage_impl( + getDisplayName()), static_cast< OWeakObject * >(this), e); } - catch (const RuntimeException &e) { - SAL_WARN("desktop.deployment", "unexpected " << e); + catch (const RuntimeException &) { + TOOLS_WARN_EXCEPTION("desktop.deployment", "unexpected"); throw; } catch (const CommandFailedException &) { diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 6357eef886ef..eba0652977fc 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -1135,10 +1135,9 @@ void BackendImpl::PackageImpl::exportTo( OUString(), ucb::NameClash::OVERWRITE ); bSuccess = true; } - catch (const css::ucb::ContentCreationException &e) + catch (const css::ucb::ContentCreationException &) { - SAL_WARN( - "desktop.deployment", "exception on overwriting manifest: " << e); + TOOLS_WARN_EXCEPTION("desktop.deployment", "exception on overwriting manifest"); } if (!bSuccess) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a8fd89e4d523..64e3c5456aa9 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1752,7 +1752,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, catch (const uno::Exception& exception) { pLib->maLastExceptionMsg = exception.Message; - SAL_INFO("lok", "Document can't be loaded: " << exception); + TOOLS_INFO_EXCEPTION("lok", "Document can't be loaded"); } return nullptr; diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 1716a9f54325..6f481014dda9 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -36,6 +36,7 @@ #include <rtl/bootstrap.hxx> #include <rtl/uri.hxx> #include <i18nlangtag/lang.h> +#include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> #include <osl/file.hxx> #include <osl/security.hxx> @@ -205,8 +206,8 @@ void Migration::migrateSettingsIfNecessary() bool bResult = false; try { bResult = aImpl.doMigration(); - } catch (const Exception& e) { - SAL_WARN( "desktop", "doMigration(): " << e); + } catch (const Exception&) { + TOOLS_WARN_EXCEPTION( "desktop", "doMigration()"); } OSL_ENSURE(bResult, "Migration has not been successful"); } @@ -290,11 +291,10 @@ bool MigrationImpl::doMigration() uno::UNO_QUERY_THROW)->refresh(); result = true; - } catch (css::uno::Exception & e) { - SAL_WARN( + } catch (const css::uno::Exception &) { + TOOLS_WARN_EXCEPTION( "desktop.migration", - "ignored Exception \"" << e - << "\" while migrating from version \"" << m_aInfo.productname + "ignored Exception while migrating from version \"" << m_aInfo.productname << "\" data \"" << m_aInfo.userdata << "\""); } @@ -757,9 +757,8 @@ uno::Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPa xNameAccess.set( theConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), uno::UNO_QUERY_THROW ); - } catch (const css::uno::Exception& e) { - SAL_WARN( - "desktop.migration", "ignoring Exception \"" << e << "\""); + } catch (const css::uno::Exception&) { + TOOLS_WARN_EXCEPTION("desktop.migration", "ignoring"); } return xNameAccess; } @@ -834,10 +833,9 @@ void MigrationImpl::runServices() xMigrationJob->execute(uno::Sequence< NamedValue >()); - } catch (const Exception& e) { - SAL_WARN( "desktop", "Execution of migration service failed (Exception caught).\nService: " - << rMigration.service - << "\nMessage: " << e); + } catch (const Exception&) { + TOOLS_WARN_EXCEPTION( "desktop", "Execution of migration service failed. Service: " + << rMigration.service); } catch (...) { SAL_WARN( "desktop", "Execution of migration service failed (Exception caught).\nService: " << rMigration.service << "\nNo message available"); diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index ae46322a9092..b04b7d2e108a 100644 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -23,6 +23,7 @@ #include <sal/log.hxx> #include <osl/file.hxx> #include <osl/thread.h> +#include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> #include <unotools/bootstrap.hxx> #include <unotools/textsearch.hxx> @@ -269,12 +270,11 @@ void OO3ExtensionMigration::migrateExtension( const OUString& sSourceDir ) sSourceDir, uno::Sequence<beans::NamedValue>(), "user", xAbortChannel, xCmdEnv ); } - catch ( css::uno::Exception & e ) + catch ( css::uno::Exception & ) { - SAL_WARN( + TOOLS_WARN_EXCEPTION( "desktop.migration", - "Ignoring UNO Exception while migrating extension from <" - << sSourceDir << ">: " << e); + "Ignoring UNO Exception while migrating extension from <" << sSourceDir << ">"); } } diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index 26fcab414c4c..9c7991a9df44 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -28,6 +28,7 @@ #include <cppuhelper/factory.hxx> #include <cppuhelper/supportsservice.hxx> #include <sal/log.hxx> +#include <tools/diagnose_ex.h> using namespace css::bridge; using namespace css::connection; @@ -121,8 +122,8 @@ void Acceptor::run() "", m_aProtocol, rConnection, rInstanceProvider); osl::MutexGuard g(m_aMutex); m_bridges.add(rBridge); - } catch (const Exception& e) { - SAL_WARN("desktop.offacc", "caught " << e); + } catch (const Exception&) { + TOOLS_WARN_EXCEPTION("desktop.offacc", ""); // connection failed... // something went wrong during connection setup. // just wait for a new connection to accept _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits