Note that the Slice compiler never generates exception specifications for operations, regardless of whether the corresponding Slice operation definition has an exception specification or not. This is deliberate: C++ exception specifications do not add any value and are therefore not used by the Ice C++ mapping. (See
[22] for an excellent treatment of the problems associated with C++ exception specifications.)
If you throw an arbitrary C++ exception (such as an int or other unexpected type), the Ice run time catches the exception and then returns an
UnknownException to the client. Similarly, if you throw an “impossible” user exception (a user exception that is not listed in the exception specification of the operation), the client receives an
UnknownUserException.
If you throw a run-time exception, such as MemoryLimitException, the client receives an
UnknownLocalException.
1 For that reason, you should never throw system exceptions from operation implementations. If you do, all the client will see is an
UnknownLocalException, which does not tell the client anything useful.