• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16package std.core;
17
18/**
19 * Represents exception that is thrown in case of null pointer dereference
20 */
21export final class NullPointerException extends Exception {
22    constructor() {
23        super();
24    }
25
26    constructor(s: String) {
27        super(s);
28    }
29
30    constructor(s: String, cause: Object) {
31        super(s, cause);
32    }
33}
34
35// TODO(orlovskiymaxim): what cause?
36/**
37 * Represents exception that is thrown in case of ?
38 */
39export final class NoDataException extends Exception {
40    constructor() {
41        super();
42    }
43
44    constructor(s: String) {
45        super(s);
46    }
47
48    constructor(s: String, cause: Object) {
49        super(s, cause);
50    }
51}
52
53/**
54 * Represents exception that is thrown when provided argument have value outside the allowable range
55 */
56export final class ArgumentOutOfRangeException extends Exception {
57    constructor() {
58        super();
59    }
60
61    constructor(s: String) {
62        super(s);
63    }
64
65    constructor(s: String, cause: Object) {
66        super(s, cause);
67    }
68}
69
70/**
71 * Represents exception that is thrown when a method has been invoked at an illegal or inappropriate time.
72 */
73export class IllegalStateException extends Exception {
74    constructor() {
75        super();
76    }
77
78    constructor(s: String) {
79        super(s);
80    }
81
82    constructor(s: String, cause: Object) {
83        super(s, cause);
84    }
85}
86
87/**
88 * Represents exception that is thrown when class is not found
89 */
90export final class ClassNotFoundException extends Exception {
91    constructor() {
92        super();
93    }
94
95    constructor(s: String) {
96        super(s);
97    }
98
99    constructor(s: String, cause: Object) {
100        super(s, cause);
101    }
102}
103
104/**
105 * Represents exception that is thrown when verifier detects errors in class
106 */
107export final class VerifyError extends Exception {
108    constructor() {
109        super();
110    }
111
112    constructor(s: String) {
113        super(s);
114    }
115
116    constructor(s: String, cause: Object) {
117        super(s, cause);
118    }
119}
120
121/**
122 * Represents exception that is thrown when linker detects errors in class
123 */
124export final class LinkageError extends Exception {
125    constructor() {
126        super();
127    }
128
129    constructor(s: String) {
130        super(s);
131    }
132
133    constructor(s: String, cause: Object) {
134        super(s, cause);
135    }
136}
137
138/**
139 * Represents exception that is thrown when runtime detects incompatible changes in class
140 */
141export final class IncompatibleClassChangeError extends Exception {
142    constructor() {
143        super();
144    }
145
146    constructor(s: String) {
147        super(s);
148    }
149
150    constructor(s: String, cause: Object) {
151        super(s, cause);
152    }
153}
154
155/**
156 * Represents exception that is thrown when the requested operation is not supported.
157 */
158export final class UnsupportedOperationException extends Exception {
159    constructor() {
160        super();
161    }
162
163    constructor(s: String) {
164        super(s);
165    }
166
167    constructor(s: String, cause: Object) {
168        super(s, cause);
169    }
170}
171
172/**
173 * @class Represents exception that is thrown when attempting to wait, notify or notifyAll on object, that hasn't been synchronised
174 */
175export final class IllegalMonitorStateException extends Exception {
176    constructor() {
177        super();
178    }
179
180    constructor(s: String) {
181        super(s);
182    }
183
184    constructor(s: String, cause: Object) {
185        super(s, cause);
186    }
187}
188
189/**
190 * @class Represents exception that is thrown when
191 * a method has been passed an illegal argument
192 */
193export final class IllegalArgumentException extends Exception {
194    constructor() {
195        super();
196    }
197
198    constructor(s: String) {
199        super(s);
200    }
201
202    constructor(s: String, cause: Object) {
203        super(s, cause);
204    }
205}