6 local exceptions, despite their names, can propagate through Ice: ObjectNotExistException (ONE), FacetNotExistException (FNE), OperationNotExistException (OpNE), UnknownException, UnknownUserException and UnknownLocalException.
There is also an abstract base runtime exception, RequestFailedException (RFE), that cannot be sent (only derived exceptions can).
Proposals (some of them require a new Ice protocol):
Deprecate exception specifications on operations
Exception specifications come from old C++ (now gone) and checked exceptions in Java. No other language has checked exceptions.
As of Ice 4.0, an operation without an exception specification can throw any exception.
An operation with an exception specification can likewise throw any exception (as of 3.7, this is already true on the server-side). The only effect of the exception specification is to check the specified exceptions are defined in the Slice compilation unit.
In Java - and only in Java - the deprecated Slice exception specification also generates a Java exception specification on the mapped proxy method for the listed exceptions marked "java:checked".
Merge user exceptions and run-time exceptions that can propagate
They are both defined with the exception syntax in Slice. Since we also eliminate local Slice, we end up with only one kind of Slice exception. The Slice syntax for exception is identical to the Slice syntax for classes, except you can't reference an exception or put it in a container.
New Slice-defined Ice Exceptions
We define the following exceptions in the Ice Slice module:
exception RequestFailedException // matches existing abstract "local" exception
{
Identity id;
string facet;
string operation;
}
exception ObjectNotExistException : RequestFailedException // just like existing exception
{
}
exception OperationNotExistException : RequestFailedException // just like existing exception
{
}
//
// Ice received this exception but doesn't know how to unmarshal it.
//
exception UnknownException
{
string id; // Slice type-id of the exception
}
//
// A language exception that the servant implementation let escape or gave to Ice
//
exception UnhandledException // formerly UnknownException
{
string message;
}
The semantics of the new ObjectNotExistException matches the semantics of the old FacetNotExistException, i.e. "I could not find a servant for this identity+facet". The expectation is that this is fine because few apps use facets and without facets ONE and FNE have the same semantics.
In Ice 3.7 and earlier, we have two types of exceptions, both directives from the base abstract Ice::Exception:
6 local exceptions, despite their names, can propagate through Ice: ObjectNotExistException (ONE), FacetNotExistException (FNE), OperationNotExistException (OpNE), UnknownException, UnknownUserException and UnknownLocalException.
There is also an abstract base runtime exception, RequestFailedException (RFE), that cannot be sent (only derived exceptions can).
Proposals (some of them require a new Ice protocol):
Deprecate exception specifications on operations Exception specifications come from old C++ (now gone) and checked exceptions in Java. No other language has checked exceptions.
As of Ice 4.0, an operation without an exception specification can throw any exception.
An operation with an exception specification can likewise throw any exception (as of 3.7, this is already true on the server-side). The only effect of the exception specification is to check the specified exceptions are defined in the Slice compilation unit.
In Java - and only in Java - the deprecated Slice exception specification also generates a Java exception specification on the mapped proxy method for the listed exceptions marked "java:checked".
Merge user exceptions and run-time exceptions that can propagate They are both defined with the exception syntax in Slice. Since we also eliminate local Slice, we end up with only one kind of Slice exception. The Slice syntax for exception is identical to the Slice syntax for classes, except you can't reference an exception or put it in a container.
New Slice-defined Ice Exceptions We define the following exceptions in the Ice Slice module:
The semantics of the new
ObjectNotExistException
matches the semantics of the oldFacetNotExistException
, i.e. "I could not find a servant for this identity+facet". The expectation is that this is fine because few apps use facets and without facets ONE and FNE have the same semantics.