diff options
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); |