summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2004-08-31 12:11:40 +0000
committerMark Spruiell <mes@zeroc.com>2004-08-31 12:11:40 +0000
commit8dfd998c9f5f96db0de7f3d73227d6599c3724d3 (patch)
tree15482caed436112f8a28f77258c7bf0db8f7e28c /cpp/src
parentminor fix (diff)
downloadice-8dfd998c9f5f96db0de7f3d73227d6599c3724d3.tar.bz2
ice-8dfd998c9f5f96db0de7f3d73227d6599c3724d3.tar.xz
ice-8dfd998c9f5f96db0de7f3d73227d6599c3724d3.zip
catch UnknownExceptions explicitly
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Incoming.cpp72
-rw-r--r--cpp/src/Ice/IncomingAsync.cpp45
2 files changed, 117 insertions, 0 deletions
diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp
index bf23c0f87fd..6d9a7d54490 100644
--- a/cpp/src/Ice/Incoming.cpp
+++ b/cpp/src/Ice/Incoming.cpp
@@ -271,6 +271,78 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager)
__finishInvoke();
return;
}
+ catch(const UnknownLocalException& ex)
+ {
+ _is.endReadEncaps();
+
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(_response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Dispatch status position.
+ _os.write(static_cast<Byte>(DispatchUnknownLocalException));
+ _os.write(ex.unknown);
+ }
+
+ //
+ // Must be called last, so that if an exception is raised,
+ // this function is definitely *not* called.
+ //
+ __finishInvoke();
+ return;
+ }
+ catch(const UnknownUserException& ex)
+ {
+ _is.endReadEncaps();
+
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(_response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Dispatch status position.
+ _os.write(static_cast<Byte>(DispatchUnknownUserException));
+ _os.write(ex.unknown);
+ }
+
+ //
+ // Must be called last, so that if an exception is raised,
+ // this function is definitely *not* called.
+ //
+ __finishInvoke();
+ return;
+ }
+ catch(const UnknownException& ex)
+ {
+ _is.endReadEncaps();
+
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(_response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Dispatch status position.
+ _os.write(static_cast<Byte>(DispatchUnknownException));
+ _os.write(ex.unknown);
+ }
+
+ //
+ // Must be called last, so that if an exception is raised,
+ // this function is definitely *not* called.
+ //
+ __finishInvoke();
+ return;
+ }
catch(const LocalException& ex)
{
_is.endReadEncaps();
diff --git a/cpp/src/Ice/IncomingAsync.cpp b/cpp/src/Ice/IncomingAsync.cpp
index 996dbd3c1c2..5c049a1753d 100644
--- a/cpp/src/Ice/IncomingAsync.cpp
+++ b/cpp/src/Ice/IncomingAsync.cpp
@@ -133,6 +133,51 @@ IceInternal::IncomingAsync::__exception(const Exception& exc)
_os.write(ex.operation);
}
}
+ catch(const UnknownLocalException& ex)
+ {
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(_response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Dispatch status position.
+ _os.write(static_cast<Byte>(DispatchUnknownLocalException));
+ _os.write(ex.unknown);
+ }
+ }
+ catch(const UnknownUserException& ex)
+ {
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(_response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Dispatch status position.
+ _os.write(static_cast<Byte>(DispatchUnknownUserException));
+ _os.write(ex.unknown);
+ }
+ }
+ catch(const UnknownException& ex)
+ {
+ if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
+ {
+ __warning(ex);
+ }
+
+ if(_response)
+ {
+ _os.endWriteEncaps();
+ _os.b.resize(headerSize + 4); // Dispatch status position.
+ _os.write(static_cast<Byte>(DispatchUnknownException));
+ _os.write(ex.unknown);
+ }
+ }
catch(const LocalException& ex)
{
if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)