Frequently Asked Questions

Why do I get an Ice::UnknownException?

UnknownException has two subclasses UnknownUserException, and UnknownLocalException.

  • UnknownUserException is raised if the server implementation
    throws an Ice user exception that isn’t in the exception specification for the operation.
  • UnknownLocalException is raised if any Ice run-time exception (any exception derived from LocalException) other than ObjectNotExistException, FacetNotExistException and OperationNotExistException is thrown by the server implementation.
  • UnknownException is raised if any other exception is thrown by the server implementation. Typically, the server will give more information in the debug log if the property Ice.Warn.Dispatch has a non-zero value. Some language mappings, such as Java, also provide comprehensive information in the reason string.

If you have a C++ server under Windows that raises an UnknownException, this often means the server has suffered an access violation, causing the C++ run time to raise a structured exception that is later caught by a "catch(...)" handler in the Ice dispatch code. During debugging with Visual C++, you can trap such exceptions by setting "Debug/Exceptions/Win32 Exceptions/Access violation" to "Stop always" instead of "Stop if not handled."

You might wonder why there is an UnknownLocalException. The Ice run time knows all of the possible run-time exceptions, so why does it not return the true error to the caller? The primary reason is security: the Ice run time will not tell the client more than it needs to know. Another reason is that the client cannot do anything meaningful with more information. From a client-side perspective, you are interested in only two outcomes: did it work, or did it not work? If it didn’t work, you need to know whether the problem is a client-side or a server-side issue. The run-time exceptions that are returned to the client allow you to make this decision; other details about the exception are a server-side concern, and therefore not provided to the client.

Copyright © 2008 ZeroC, Inc.