diff options
author | Mark Spruiell <mes@zeroc.com> | 2006-12-15 21:21:22 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2006-12-15 21:21:22 +0000 |
commit | 7f89dc8a214008a17a2e680db8c2d27efb614b19 (patch) | |
tree | b9b491ac1695a594dcb9ad8560c7643e2515d2cf /py/modules/IcePy/Util.cpp | |
parent | Added custom logger (diff) | |
download | ice-7f89dc8a214008a17a2e680db8c2d27efb614b19.tar.bz2 ice-7f89dc8a214008a17a2e680db8c2d27efb614b19.tar.xz ice-7f89dc8a214008a17a2e680db8c2d27efb614b19.zip |
handle InitializationException
Diffstat (limited to 'py/modules/IcePy/Util.cpp')
-rw-r--r-- | py/modules/IcePy/Util.cpp | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/py/modules/IcePy/Util.cpp b/py/modules/IcePy/Util.cpp index ff7dc6e026b..110e4c405b0 100644 --- a/py/modules/IcePy/Util.cpp +++ b/py/modules/IcePy/Util.cpp @@ -493,6 +493,37 @@ convertLocalException(const Ice::LocalException& ex, PyObject* p) { ex.ice_throw(); } + catch(const Ice::InitializationException& e) + { + IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.reason.c_str())); + PyObject_SetAttrString(p, STRCAST("reason"), m.get()); + } + catch(const Ice::PluginInitializationException& e) + { + IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.reason.c_str())); + PyObject_SetAttrString(p, STRCAST("reason"), m.get()); + } + catch(const Ice::AlreadyRegisteredException& e) + { + IcePy::PyObjectHandle m; + m = PyString_FromString(const_cast<char*>(e.kindOfObject.c_str())); + PyObject_SetAttrString(p, STRCAST("kindOfObject"), m.get()); + m = PyString_FromString(const_cast<char*>(e.id.c_str())); + PyObject_SetAttrString(p, STRCAST("id"), m.get()); + } + catch(const Ice::NotRegisteredException& e) + { + IcePy::PyObjectHandle m; + m = PyString_FromString(const_cast<char*>(e.kindOfObject.c_str())); + PyObject_SetAttrString(p, STRCAST("kindOfObject"), m.get()); + m = PyString_FromString(const_cast<char*>(e.id.c_str())); + PyObject_SetAttrString(p, STRCAST("id"), m.get()); + } + catch(const Ice::TwowayOnlyException& e) + { + IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.operation.c_str())); + PyObject_SetAttrString(p, STRCAST("operation"), m.get()); + } catch(const Ice::UnknownException& e) { IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.unknown.c_str())); @@ -610,32 +641,6 @@ convertLocalException(const Ice::LocalException& ex, PyObject* p) IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.reason.c_str())); PyObject_SetAttrString(p, STRCAST("reason"), m.get()); } - catch(const Ice::PluginInitializationException& e) - { - IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.reason.c_str())); - PyObject_SetAttrString(p, STRCAST("reason"), m.get()); - } - catch(const Ice::AlreadyRegisteredException& e) - { - IcePy::PyObjectHandle m; - m = PyString_FromString(const_cast<char*>(e.kindOfObject.c_str())); - PyObject_SetAttrString(p, STRCAST("kindOfObject"), m.get()); - m = PyString_FromString(const_cast<char*>(e.id.c_str())); - PyObject_SetAttrString(p, STRCAST("id"), m.get()); - } - catch(const Ice::NotRegisteredException& e) - { - IcePy::PyObjectHandle m; - m = PyString_FromString(const_cast<char*>(e.kindOfObject.c_str())); - PyObject_SetAttrString(p, STRCAST("kindOfObject"), m.get()); - m = PyString_FromString(const_cast<char*>(e.id.c_str())); - PyObject_SetAttrString(p, STRCAST("id"), m.get()); - } - catch(const Ice::TwowayOnlyException& e) - { - IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.operation.c_str())); - PyObject_SetAttrString(p, STRCAST("operation"), m.get()); - } catch(const Ice::FeatureNotSupportedException& e) { IcePy::PyObjectHandle m = PyString_FromString(const_cast<char*>(e.unsupportedFeature.c_str())); |