Skip to content

Commit a0d3cb0

Browse files
committed
JS 'Error' objects now type aliases of 'exn' type.
1 parent 486a202 commit a0d3cb0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Errors.re

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ external setStackTraceLimit: int => Js.Undefined.t('a) = "setStackTraceLimit";
1414
let setStackTraceLimit: int => unit = n => setStackTraceLimit(n)->ignore;
1515

1616
module Error = {
17-
type t;
17+
type t = exn;
1818
type constructor;
1919
[@bs.val] external constructor: constructor = "Error";
2020
[@bs.new] external make: string => t = "Error";
@@ -41,7 +41,7 @@ module Error = {
4141
};
4242

4343
module AssertionError = {
44-
type t;
44+
type t = exn;
4545
type constructor;
4646
type makeOptions;
4747
[@bs.obj]
@@ -85,7 +85,7 @@ module AssertionError = {
8585
};
8686

8787
module EvalError = {
88-
type t;
88+
type t = exn;
8989
type constructor;
9090
[@bs.val] external constructor: constructor = "EvalError";
9191
[@bs.new] external make: string => t = "EvalError";
@@ -111,7 +111,7 @@ module EvalError = {
111111
};
112112

113113
module RangeError = {
114-
type t;
114+
type t = exn;
115115
type constructor;
116116
[@bs.val] external constructor: constructor = "RangeError";
117117
[@bs.new] external make: string => t = "RangeError";
@@ -138,7 +138,7 @@ module RangeError = {
138138
};
139139

140140
module ReferenceError = {
141-
type t;
141+
type t = exn;
142142
type constructor;
143143
[@bs.val] external constructor: constructor = "ReferenceError";
144144
[@bs.new] external make: string => t = "ReferenceError";
@@ -165,7 +165,7 @@ module ReferenceError = {
165165
};
166166

167167
module SyntaxError = {
168-
type t;
168+
type t = exn;
169169
type constructor;
170170
[@bs.val] external constructor: constructor = "SyntaxError";
171171
[@bs.new] external make: string => t = "SyntaxError";
@@ -195,7 +195,7 @@ module SyntaxError = {
195195
// `SystemError` is an undefined identifier at runtime.
196196

197197
module SystemError = {
198-
type t;
198+
type t = exn;
199199
[@bs.get] external name: t => string = "name";
200200
[@bs.get] [@bs.return nullable]
201201
external address: t => option(string) = "address";
@@ -213,7 +213,7 @@ module SystemError = {
213213
};
214214

215215
module TypeError = {
216-
type t;
216+
type t = exn;
217217
type constructor;
218218
[@bs.val] external constructor: constructor = "TypeError";
219219
[@bs.new] external make: string => t = "TypeError";
@@ -240,7 +240,7 @@ module TypeError = {
240240
};
241241

242242
module URIError = {
243-
type t;
243+
type t = exn;
244244
type constructor;
245245
[@bs.val] external constructor: constructor = "URIError";
246246
[@bs.new] external make: string => t = "URIError";

0 commit comments

Comments
 (0)