summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/Util.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2004-11-02 01:46:43 +0000
committerMark Spruiell <mes@zeroc.com>2004-11-02 01:46:43 +0000
commite2c05038c6530a893d2dafe8ed2de1f2b3b66b99 (patch)
tree8797201b4d7dccc5e294b2fff02822629b880fcb /py/modules/IcePy/Util.cpp
parentfixing comparison problems (diff)
downloadice-e2c05038c6530a893d2dafe8ed2de1f2b3b66b99.tar.bz2
ice-e2c05038c6530a893d2dafe8ed2de1f2b3b66b99.tar.xz
ice-e2c05038c6530a893d2dafe8ed2de1f2b3b66b99.zip
adding support for ProtocolException reason member
Diffstat (limited to 'py/modules/IcePy/Util.cpp')
-rw-r--r--py/modules/IcePy/Util.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/py/modules/IcePy/Util.cpp b/py/modules/IcePy/Util.cpp
index 199e5698a66..70d33cb8f2b 100644
--- a/py/modules/IcePy/Util.cpp
+++ b/py/modules/IcePy/Util.cpp
@@ -339,6 +339,8 @@ convertLocalException(const Ice::LocalException& ex, PyObject* p)
catch(const Ice::UnsupportedProtocolException& e)
{
IcePy::PyObjectHandle m;
+ m = PyString_FromString(const_cast<char*>(e.reason.c_str()));
+ PyObject_SetAttrString(p, "reason", m.get());
m = PyInt_FromLong(e.badMajor);
PyObject_SetAttrString(p, "badMajor", m.get());
m = PyInt_FromLong(e.badMinor);
@@ -351,6 +353,8 @@ convertLocalException(const Ice::LocalException& ex, PyObject* p)
catch(const Ice::UnsupportedEncodingException& e)
{
IcePy::PyObjectHandle m;
+ m = PyString_FromString(const_cast<char*>(e.reason.c_str()));
+ PyObject_SetAttrString(p, "reason", m.get());
m = PyInt_FromLong(e.badMajor);
PyObject_SetAttrString(p, "badMajor", m.get());
m = PyInt_FromLong(e.badMinor);
@@ -360,20 +364,23 @@ convertLocalException(const Ice::LocalException& ex, PyObject* p)
m = PyInt_FromLong(e.minor);
PyObject_SetAttrString(p, "minor", m.get());
}
- catch(const Ice::CompressionException& e)
+ catch(const Ice::NoObjectFactoryException& e)
{
- IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.reason.c_str()));
+ IcePy::PyObjectHandle m;
+ m = PyString_FromString(const_cast<char*>(e.reason.c_str()));
PyObject_SetAttrString(p, "reason", m.get());
+ m = PyString_FromString(const_cast<char*>(e.type.c_str()));
+ PyObject_SetAttrString(p, "type", m.get());
}
- catch(const Ice::PluginInitializationException& e)
+ catch(const Ice::ProtocolException& e)
{
IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.reason.c_str()));
PyObject_SetAttrString(p, "reason", m.get());
}
- catch(const Ice::NoObjectFactoryException& e)
+ catch(const Ice::PluginInitializationException& e)
{
- IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.type.c_str()));
- PyObject_SetAttrString(p, "type", m.get());
+ IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.reason.c_str()));
+ PyObject_SetAttrString(p, "reason", m.get());
}
catch(const Ice::AlreadyRegisteredException& e)
{