diff options
author | Michi Henning <michi@zeroc.com> | 2005-07-15 01:50:32 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2005-07-15 01:50:32 +0000 |
commit | 0275da85d4593a8db0600a160d93dd9626d5dbbc (patch) | |
tree | ac583326d499bc739c2c4c94b6c99d2204018f28 /cpp | |
parent | fixed missing int->char conversion (diff) | |
download | ice-0275da85d4593a8db0600a160d93dd9626d5dbbc.tar.bz2 ice-0275da85d4593a8db0600a160d93dd9626d5dbbc.tar.xz ice-0275da85d4593a8db0600a160d93dd9626d5dbbc.zip |
Improved excpetion info for NoObjectFactoryException. When sliced to
Object, the original most derived type ID is now reported.
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/slice/Ice/Communicator.ice | 3 | ||||
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/cpp/slice/Ice/Communicator.ice b/cpp/slice/Ice/Communicator.ice index f4c07ade4ad..1a6bf69b81d 100644 --- a/cpp/slice/Ice/Communicator.ice +++ b/cpp/slice/Ice/Communicator.ice @@ -180,8 +180,7 @@ local interface Communicator * either because no factory was found, or because all factories * returned nil, the object is sliced to the next most-derived type * and the process repeats. If no factory is found that can create an - * instance, the Ice run-time will slice the object to the type - * Ice::Object.</para> + * instance, the Ice run-time throws [NoObjectFactoryException].</para> * * <para>The following order is used to locate a factory for a type: * diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index 112b492dc62..ac5d470f146 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -1514,18 +1514,20 @@ IceInternal::BasicStream::read(PatchFunc patchFunc, void* patchAddr) } assert(index > 0); + string mostDerivedId; + readTypeId(mostDerivedId); + string id = mostDerivedId; while(true) { - string id; - readTypeId(id); - // // If we slice all the way down to Ice::Object, we throw // because Ice::Object is abstract. // if(id == Ice::Object::ice_staticId()) { - throw NoObjectFactoryException(__FILE__, __LINE__, "class sliced to ::Ice::Object, which is abstract", id); + throw NoObjectFactoryException(__FILE__, __LINE__, + "class sliced to ::Ice::Object, which is abstract", + mostDerivedId); } // @@ -1581,6 +1583,7 @@ IceInternal::BasicStream::read(PatchFunc patchFunc, void* patchAddr) traceSlicing("class", id, _slicingCat, _instance->logger()); } skipSlice(); // Slice off this derived part -- we don't understand it. + readTypeId(id); // Read next id for next iteration. continue; } else |