summaryrefslogtreecommitdiff
path: root/js/src/Ice/Exception.d.ts
blob: 522f0887fd034456ba70056888a095495d0f7c21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

declare module "ice"
{
    namespace Ice
    {
        /**
         * Base class for all Ice exceptions.
         */
        abstract class Exception extends Error
        {
            /**
             * Returns the name of this exception.
             *
             * @return The name of this exception.
             *
             * @deprecated ice_name() is deprecated, use ice_id() instead.
             **/
            ice_name():string;

            /**
             * Returns the type id of this exception.
             *
             * @return The type id of this exception.
             **/
            ice_id():string;

            /**
             * Returns a string representation of this exception.
             *
             * @return A string representation of this exception.
             **/
            toString():string;

            ice_cause:string|Error;
        }

        /**
         * Base class for all Ice run-time exceptions.
         */
        abstract class LocalException extends Exception {}

        /**
         * Base class for all Ice user exceptions.
         */
        abstract class UserException extends Exception
        {
            /**
             * Obtains the sliced data associated with this instance.
             * @return The sliced data if the exception has a preserved-slice base class and has been sliced during
             * unmarshaling of the exception, nil otherwise.
             */
            ice_getSlicedData():SlicedData;

            /**
             * Obtains the Slice type ID of this exception.
             * @return The fully-scoped type ID.
             */
            static ice_staticId():string;
        }
    }
}