summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Incoming.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/Incoming.cpp')
-rw-r--r--cpp/src/Ice/Incoming.cpp77
1 files changed, 25 insertions, 52 deletions
diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp
index 995f90d4085..8e6458aae69 100644
--- a/cpp/src/Ice/Incoming.cpp
+++ b/cpp/src/Ice/Incoming.cpp
@@ -132,21 +132,16 @@ IceInternal::Incoming::invoke(bool response)
if(status != DispatchOK && status != DispatchUserException)
{
+ assert(status == DispatchObjectNotExist ||
+ status == DispatchFacetNotExist ||
+ status == DispatchOperationNotExist);
+
_os.b.resize(statusPos);
_os.write(static_cast<Byte>(status));
- if(status == DispatchObjectNotExist)
- {
- current.id.__write(&_os);
- }
- else if(status == DispatchFacetNotExist)
- {
- _os.write(current.facet);
- }
- else if(status == DispatchOperationNotExist)
- {
- _os.write(current.operation);
- }
+ current.id.__write(&_os);
+ _os.write(current.facet);
+ _os.write(current.operation);
}
else
{
@@ -171,7 +166,7 @@ IceInternal::Incoming::invoke(bool response)
_os.write(ex._prx);
}
}
- catch(const ObjectNotExistException& ex)
+ catch(const RequestFailedException& ex)
{
if(locator && servant)
{
@@ -184,51 +179,29 @@ IceInternal::Incoming::invoke(bool response)
{
_os.endWriteEncaps();
_os.b.resize(statusPos);
- _os.write(static_cast<Byte>(DispatchObjectNotExist));
+ if(dynamic_cast<const ObjectNotExistException*>(&ex))
+ {
+ _os.write(static_cast<Byte>(DispatchObjectNotExist));
+ }
+ else if(dynamic_cast<const FacetNotExistException*>(&ex))
+ {
+ _os.write(static_cast<Byte>(DispatchFacetNotExist));
+ }
+ else if(dynamic_cast<const OperationNotExistException*>(&ex))
+ {
+ _os.write(static_cast<Byte>(DispatchOperationNotExist));
+ }
+ else
+ {
+ assert(false);
+ }
+
// Not current.id.__write(_os), so that the identity
// can be overwritten.
ex.id.__write(&_os);
- }
-
- // Rethrow, so that the caller can print a warning.
- ex.ice_throw();
- }
- catch(const FacetNotExistException& ex)
- {
- if(locator && servant)
- {
- assert(_adapter);
- locator->finished(current, servant, cookie);
- }
-
- _is.endReadEncaps();
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(statusPos);
- _os.write(static_cast<Byte>(DispatchFacetNotExist));
// Not _os.write(current.facet), so that the facet can
// be overwritten.
_os.write(ex.facet);
- }
-
- // Rethrow, so that the caller can print a warning.
- ex.ice_throw();
- }
- catch(const OperationNotExistException& ex)
- {
- if(locator && servant)
- {
- assert(_adapter);
- locator->finished(current, servant, cookie);
- }
-
- _is.endReadEncaps();
- if(response)
- {
- _os.endWriteEncaps();
- _os.b.resize(statusPos);
- _os.write(static_cast<Byte>(DispatchOperationNotExist));
// Not _os.write(current.operation), so that the operation
// can be overwritten.
_os.write(ex.operation);