summaryrefslogtreecommitdiff
path: root/python/modules/IcePy/Operation.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-06-01 11:56:19 +0200
committerBenoit Foucher <benoit@zeroc.com>2017-06-01 11:56:19 +0200
commit55032fe5507062f344f5289c29199006b96a94b0 (patch)
treea03f8cbbef86a3caf5b8c4b225e7b1469aef4a9d /python/modules/IcePy/Operation.cpp
parentFixed ICE-7954 - bug in Object::ice_dispatch (diff)
downloadice-55032fe5507062f344f5289c29199006b96a94b0.tar.bz2
ice-55032fe5507062f344f5289c29199006b96a94b0.tar.xz
ice-55032fe5507062f344f5289c29199006b96a94b0.zip
Additional fix for ICE-7884 - TwowayOnlyException
Diffstat (limited to 'python/modules/IcePy/Operation.cpp')
-rw-r--r--python/modules/IcePy/Operation.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/python/modules/IcePy/Operation.cpp b/python/modules/IcePy/Operation.cpp
index c75512de517..d3e7493d2ce 100644
--- a/python/modules/IcePy/Operation.cpp
+++ b/python/modules/IcePy/Operation.cpp
@@ -222,8 +222,6 @@ protected:
private:
- void checkAsyncTwowayOnly(const Ice::ObjectPrx&) const;
-
OperationPtr _op;
};
@@ -2719,13 +2717,12 @@ IcePy::NewAsyncInvocation::invoke(PyObject* args, PyObject* kwds)
setPythonException(ex);
return 0;
}
- catch(const IceUtil::IllegalArgumentException& ex)
+ catch(const Ice::TwowayOnlyException& ex)
{
//
- // IllegalArgumentException can propagate directly.
- // (Raised by checkAsyncTwowayOnly)
+ // TwowayOnlyException can propagate directly.
//
- PyErr_Format(PyExc_RuntimeError, "%s", STRCAST(ex.reason().c_str()));
+ setPythonException(ex);
return 0;
}
catch(const Ice::Exception&)
@@ -2979,7 +2976,7 @@ IcePy::NewAsyncTypedInvocation::handleInvoke(PyObject* args, PyObject* /* kwds *
return 0;
}
- checkAsyncTwowayOnly(_prx);
+ checkTwowayOnly(_op, _prx);
NewAsyncInvocationPtr self = this;
Ice::Callback_Object_ice_invokePtr cb =
@@ -3082,16 +3079,6 @@ IcePy::NewAsyncTypedInvocation::handleResponse(PyObject* future, bool ok,
}
}
-void
-IcePy::NewAsyncTypedInvocation::checkAsyncTwowayOnly(const Ice::ObjectPrx& proxy) const
-{
- if((_op->returnType != 0 || !_op->outParams.empty() || !_op->exceptions.empty()) && !proxy->ice_isTwoway())
- {
- throw IceUtil::IllegalArgumentException(__FILE__, __LINE__,
- "`" + _op->name + "' can only be called with a twoway proxy");
- }
-}
-
//
// SyncBlobjectInvocation
//