diff options
author | Mark Spruiell <mes@zeroc.com> | 2004-09-20 19:31:49 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2004-09-20 19:31:49 +0000 |
commit | ba17cde15e8f2a838700cf12cc047b0864e5b94b (patch) | |
tree | d0640cd2794218b93de50b8095851f54f98b7038 /py/modules/IcePy/Operation.cpp | |
parent | use threads to allow signal handling (diff) | |
download | ice-ba17cde15e8f2a838700cf12cc047b0864e5b94b.tar.bz2 ice-ba17cde15e8f2a838700cf12cc047b0864e5b94b.tar.xz ice-ba17cde15e8f2a838700cf12cc047b0864e5b94b.zip |
store exception and class info in ice_type class member
Diffstat (limited to 'py/modules/IcePy/Operation.cpp')
-rw-r--r-- | py/modules/IcePy/Operation.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/py/modules/IcePy/Operation.cpp b/py/modules/IcePy/Operation.cpp index a886a534a79..e49e4c6d2d9 100644 --- a/py/modules/IcePy/Operation.cpp +++ b/py/modules/IcePy/Operation.cpp @@ -874,26 +874,18 @@ IcePy::OperationI::sendException(const Ice::AMD_Object_ice_invokePtr& cb, PyObje if(PyErr_GivenExceptionMatches(exType, userExceptionType)) { // - // Get the exception's id and Verify that it is legal to be thrown from this operation. + // Get the exception's type and verify that it is legal to be thrown from this operation. // - PyObjectHandle id = PyObject_CallMethod(ex, "ice_id", NULL); - PyErr_Clear(); - if(id.get() == NULL || !validateException(ex)) + PyObjectHandle iceType = PyObject_GetAttrString(ex, "ice_type"); + assert(iceType.get() != NULL); + ExceptionInfoPtr info = ExceptionInfoPtr::dynamicCast(getException(iceType.get())); + assert(info); + if(!validateException(ex)) { throwPythonException(ex); // Raises UnknownUserException. } else { - assert(PyString_Check(id.get())); - char* str = PyString_AS_STRING(id.get()); - ExceptionInfoPtr info = lookupExceptionInfo(str); - if(!info) - { - Ice::UnknownUserException e(__FILE__, __LINE__); - e.unknown = str; - throw e; - } - Ice::OutputStreamPtr os = Ice::createOutputStream(communicator); ObjectMap objectMap; info->marshal(ex, os, &objectMap); |