Preliminary documentation for Ice 3.7.1 Beta. Do not use in production applications. Refer to the space directory for other releases.

On this page:

Mapped JavaScript Class

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

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

is mapped to the JavaScript class InitializationException:

JavaScript
InitializationException = class extends Ice.LocalException
{
    ...
};

Base Class for Local Exceptions in JavaScript

All mapped JavaScript classes for local exceptions extend the class Ice.LocalException:

JavaScript
LocalException = class extends Exception
{
    ...
};

LocalException derives from Ice.Exception, which derives from JavaScript's native Error class.

Mapping for Local Exception Inheritance in JavaScript

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

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

is mapped to:

JavaScript
ErrorBase = class extends Ice.LocalException
{
    ...
};
ResourceError = class extends ErrorBase
{
    ...
};

  • No labels