summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-06-16 15:37:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-17 08:18:51 +0200
commitf41a55474cb6217560af81ae99c3e2fe1aca5215 (patch)
tree703ddebaa16e967ff0529b0bfe8667661a6abae7 /scripting
parentc77a1e1c039c863e6fdb47b92ce315b87fc73d0d (diff)
loplugin:logexceptionnicely in scripting..sdext
Change-Id: Ib08f41bb0bed494e7ed00f5bae92eae2b8e80d93 Reviewed-on: https://gerrit.libreoffice.org/74113 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scripting')
-rw-r--r--scripting/Library_protocolhandler.mk1
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx13
-rw-r--r--scripting/source/provider/BrowseNodeFactoryImpl.cxx4
-rw-r--r--scripting/source/provider/MasterScriptProvider.cxx10
-rw-r--r--scripting/source/vbaevents/eventhelper.cxx5
5 files changed, 17 insertions, 16 deletions
diff --git a/scripting/Library_protocolhandler.mk b/scripting/Library_protocolhandler.mk
index e140bb322008..3d243f7f849b 100644
--- a/scripting/Library_protocolhandler.mk
+++ b/scripting/Library_protocolhandler.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_Library_use_libraries,protocolhandler,\
fwe \
sal \
sfx \
+ tl \
vcl \
))
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 07c4353893d6..dff0f3513e4b 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -158,12 +158,11 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
{
xListener->dispatchFinished( aEvent ) ;
}
- catch(RuntimeException & e)
+ catch(const RuntimeException &)
{
- SAL_WARN("scripting",
+ TOOLS_WARN_EXCEPTION("scripting",
"ScriptProtocolHandler::dispatchWithNotification: caught RuntimeException"
- "while dispatchFinished with failure of the execution "
- << e );
+ "while dispatchFinished with failure of the execution");
}
}
return;
@@ -285,11 +284,11 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
{
xListener->dispatchFinished( aEvent ) ;
}
- catch(const RuntimeException & e)
+ catch(const RuntimeException &)
{
- SAL_WARN("scripting",
+ TOOLS_WARN_EXCEPTION("scripting",
"ScriptProtocolHandler::dispatchWithNotification: caught RuntimeException"
- "while dispatchFinished " << e );
+ "while dispatchFinished" );
}
}
}
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index d3fc898086b8..909443f5f511 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -282,9 +282,9 @@ std::vector< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Referen
locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( makeAny( OUString("share") ) ), UNO_QUERY_THROW );
}
// TODO proper exception handling, should throw
- catch( const Exception& e )
+ catch( const Exception& )
{
- SAL_WARN("scripting", "Caught " << e );
+ TOOLS_WARN_EXCEPTION("scripting", "Caught" );
locnBNs.resize( mspIndex );
return locnBNs;
}
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index 8daa183d5ec8..fe2d074c4632 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -209,10 +209,10 @@ void MasterScriptProvider::createPkgProvider()
xFac->createScriptProvider( location ), UNO_SET_THROW );
}
- catch ( const Exception& e )
+ catch ( const Exception& )
{
- SAL_WARN("scripting.provider", "Exception creating MasterScriptProvider for uno_packages in context "
- << m_sCtxString << ": " << e );
+ TOOLS_WARN_EXCEPTION("scripting.provider", "Exception creating MasterScriptProvider for uno_packages in context "
+ << m_sCtxString );
}
}
@@ -470,9 +470,9 @@ template <typename Proc> bool FindProviderAndApply(ProviderCache& rCache, Proc p
if (bResult)
break;
}
- catch (Exception& e)
+ catch (const Exception&)
{
- SAL_INFO("scripting.provider", "ignoring " << e);
+ TOOLS_INFO_EXCEPTION("scripting.provider", "ignoring");
}
}
return bResult;
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index 21a52e9b28c4..8388450aa2b2 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -23,6 +23,7 @@
#include <comphelper/uno3.hxx>
#include <comphelper/proparrhlp.hxx>
#include <comphelper/propertycontainer.hxx>
+#include <tools/diagnose_ex.h>
#include <ooo/vba/XVBAToOOEventDescGen.hpp>
@@ -909,9 +910,9 @@ EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet )
ooo::vba::executeMacro( mpShell, url, aArguments, aRet, aDummyCaller );
}
}
- catch ( uno::Exception& e )
+ catch ( const uno::Exception& )
{
- SAL_WARN("scripting", "event script raised " << e );
+ TOOLS_WARN_EXCEPTION("scripting", "event script raised" );
}
}
}