Java Compat Mapping for Local Exceptions

On this page:

Mapped Java Class

A local Slice exception is mapped to a Java class with the same name. For example:

Slice
module Ice
{
    local exception InitializationException
    {
        ...
    }
}

is mapped to the Java class InitializationException:

Java
package Ice;
 
public class InitializationException extends LocalException
{
    ...
}

Base Class for Local Exceptions in Java

All mapped Java classes for local exceptions extend the abstract class LocalException:

Java
package Ice;
 
public abstract class LocalException extends Exception
{
    public LocalException() {}
    public LocalException(Throwable cause) { ... }
}

Mapping for Local Exception Inheritance in Java

A local Slice exception can extend another Slice exception, which is mapped to extends in Java. For example:

Slice
module M
{
    local exception ErrorBase {}
    local exception ResourceError extends ErrorBase {}
}

is mapped to:

Java
package M;
public class ErrorBase extends com.zeroc.Ice.LocalException { ... }
public class ResourceError extends ErrorBase { ... }