summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-07-28 20:00:26 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-08-04 18:49:48 +0200
commitce2792eda318b2760d24d2a744fc89e6a1d87138 (patch)
tree55ee0998313380481b566c5ff9874f02d5ea5308 /scripting
parentf9309a171a762b888bdfbea1dba8cbc1683be089 (diff)
use C++11 exception rethrowing
for those cases where we are doing relatively simple catching and rethrowing e.g. catch in one thread and throw in main thread. Change-Id: I6192017c4ec99dd671a9582f7b004096b0fc4525 Reviewed-on: https://gerrit.libreoffice.org/58588 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 39991b37e6f7..f8ad8c7fd63d 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -210,7 +210,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
bSuccess = false;
while ( !bSuccess )
{
- Any aFirstCaughtException;
+ std::exception_ptr aFirstCaughtException;
try
{
invokeResult = xFunc->invoke( inArgs, outIndex, outArgs );
@@ -218,17 +218,17 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
}
catch( const provider::ScriptFrameworkErrorException& se )
{
- if ( !aFirstCaughtException.hasValue() )
- aFirstCaughtException = ::cppu::getCaughtException();
+ if (!aFirstCaughtException)
+ aFirstCaughtException = std::current_exception();
if ( se.errorType != provider::ScriptFrameworkErrorType::NO_SUCH_SCRIPT )
// the only condition which allows us to retry is if there is no method with the
// given name/signature
- ::cppu::throwException( aFirstCaughtException );
+ std::rethrow_exception(aFirstCaughtException);
if ( inArgs.getLength() == 0 )
// no chance to retry if we can't strip more in-args
- ::cppu::throwException( aFirstCaughtException );
+ std::rethrow_exception(aFirstCaughtException);
// strip one argument, then retry
inArgs.realloc( inArgs.getLength() - 1 );