diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-06-12 16:50:58 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-06-12 16:50:58 +0200 |
commit | b2c3f4fe51800183e78db500b1e91d0135689caf (patch) | |
tree | f515d08d95609db34b4a6b2c898a488e5fe6be4d /cpp/src/Ice/Exception.cpp | |
parent | demo fixes (diff) | |
download | ice-b2c3f4fe51800183e78db500b1e91d0135689caf.tar.bz2 ice-b2c3f4fe51800183e78db500b1e91d0135689caf.tar.xz ice-b2c3f4fe51800183e78db500b1e91d0135689caf.zip |
Fixed support unknown types in unknown optionals
Diffstat (limited to 'cpp/src/Ice/Exception.cpp')
-rw-r--r-- | cpp/src/Ice/Exception.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index 002851f917d..a205af22a78 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -26,8 +26,20 @@ namespace Ex { void -throwUOE(const string& expectedType, const string& type) +throwUOE(const string& expectedType, const ObjectPtr& v) { + // + // If the object is an unknown sliced object, we didn't find an + // object factory, in this case raise a NoObjectFactoryException + // instead. + // + UnknownSlicedObject* uso = dynamic_cast<UnknownSlicedObject*>(v.get()); + if(uso) + { + throw NoObjectFactoryException(__FILE__, __LINE__, "", uso->getUnknownTypeId()); + } + + string type = v->ice_id(); throw Ice::UnexpectedObjectException(__FILE__, __LINE__, "expected element of type `" + expectedType + "' but received '" + type, type, expectedType); |