C-Sharp Mapping for Local Exceptions

On this page:

Mapped C# Class

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

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

is mapped to the C# class InitializationException:

C#
namespace Ice
{
    public partial class InitializationException : LocalException
    {
        ...
    }
}

Base Class for Local Exceptions in Java

All mapped C# classes for local exceptions derive from LocalException:

C#
namespace Ice
{
    [Serializable]
    public abstract class LocalException : Exception
    {
        public LocalException() {}
        public LocalException(System.Exception ex) { ... }
        ...
    }
}


Mapping for Local Exception Inheritance in C#

A local Slice exception can extend another Slice exception, which is mapped to class inheritance in C#. For example:

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

is mapped to:

C#
namespace M
{
    public partial class ErrorBase : Ice.LocalException { ... }
    public partial class ResourceError : ErrorBase { ... }
}