The ancestor of all exceptions is System.Exception. Derived from that is
Ice.Exception, which provides the definitions of a number of constructors.
Ice.LocalException and
Ice.UserException are derived from
Ice.Exception and form the base of all run-time and user exceptions, respectively.
The constructors defined in Ice.Exception have the following signatures:
Each concrete derived exception class implements these constructors. The second constructor initializes the
InnerException property of
System.Exception. (Both constructors set the
Message property to the empty string.)
Each Slice exception is mapped to a C# class with the same name. For each exception member, the corresponding class contains a public data member. (Obviously, because
BadTimeVal and
BadZoneName do not have members, the generated classes for these exceptions also do not have members.)
All user exceptions are derived from the base class Ice.UserException. This allows you to catch all user exceptions generically by installing a handler for
Ice.UserException. Similarly, you can catch all Ice run-time exceptions with a handler for
Ice.LocalException, and you can catch all Ice exceptions with a handler for
Ice.Exception.
If an exception (or one of its base exceptions) contains data members, the mapping generates two additional constructors. These constructors allow you to instantiate and initialize an exception in a single statement, instead of having to first instantiate the exception and then assign to its members. For derived exceptions, the constructors accept one argument for each base exception member, plus one argument for each derived exception member, in base-to-derived order. The second of these constructors has a trailing parameter of type
System.Exception which initializes the
InnerException property of the
System.Exception base exception.
The generated exception classes also contain other member functions that are not shown here; these member functions are internal to the C# mapping and are not meant to be called by application code.