@@ -27,18 +27,44 @@ Provide utilities for dealing with JS exceptions.
2727*/
2828
2929/** Represents a JS exception */
30- @deprecated ("Use `JsExn.t` instead" )
30+ @deprecated ({
31+ reason : "Use `JsExn.t` instead" ,
32+ migrate : %replace.type (: JsExn .t ),
33+ })
3134type t
3235
3336type exn += private Error (t )
3437
35- @deprecated ("Use `JsExn.fromException` instead" )
38+ @deprecated ({
39+ reason : "Use `JsExn.fromException` instead" ,
40+ migrate : JsExn .fromException (),
41+ })
3642let asJsExn : exn => option <t >
3743
38- @deprecated ("Use `JsExn.stack` instead" ) @get external stack : t => option <string > = "stack"
39- @deprecated ("Use `JsExn.message` instead" ) @get external message : t => option <string > = "message"
40- @deprecated ("Use `JsExn.name` instead" ) @get external name : t => option <string > = "name"
41- @deprecated ("Use `JsExn.fileName` instead" ) @get external fileName : t => option <string > = "fileName"
44+ @deprecated ({
45+ reason : "Use `JsExn.stack` instead" ,
46+ migrate : JsExn .stack (),
47+ })
48+ @get
49+ external stack : t => option <string > = "stack"
50+ @deprecated ({
51+ reason : "Use `JsExn.message` instead" ,
52+ migrate : JsExn .message (),
53+ })
54+ @get
55+ external message : t => option <string > = "message"
56+ @deprecated ({
57+ reason : "Use `JsExn.name` instead" ,
58+ migrate : JsExn .name (),
59+ })
60+ @get
61+ external name : t => option <string > = "name"
62+ @deprecated ({
63+ reason : "Use `JsExn.fileName` instead" ,
64+ migrate : JsExn .fileName (),
65+ })
66+ @get
67+ external fileName : t => option <string > = "fileName"
4268
4369/**
4470`anyToExnInternal(obj)` will take any value `obj` and wrap it
@@ -51,23 +77,47 @@ a value passed to a Promise.catch callback)
5177
5278**IMPORTANT**: This is an internal API and may be changed / removed any time in the future.
5379*/
54- @deprecated ("Use `JsExn.anyToExnInternal` instead" )
80+ @deprecated ({
81+ reason : "Use `JsExn.anyToExnInternal` instead" ,
82+ migrate : JsExn .anyToExnInternal (),
83+ })
5584external anyToExnInternal : 'a => exn = "%wrap_exn"
5685
5786/** Raise Js exception Error object with stacktrace */
58- @deprecated ("Use `JsError.throwWithMessage` instead" )
87+ @deprecated ({
88+ reason : "Use `JsError.throwWithMessage` instead" ,
89+ migrate : JsError .throwWithMessage (),
90+ })
5991let raiseError : string => 'a
60- @deprecated ("Use `JsError.EvalError.throwWithMessage` instead" )
92+ @deprecated ({
93+ reason : "Use `JsError.EvalError.throwWithMessage` instead" ,
94+ migrate : JsError .EvalError .throwWithMessage (),
95+ })
6196let raiseEvalError : string => 'a
62- @deprecated ("Use `JsError.RangeError.throwWithMessage` instead" )
97+ @deprecated ({
98+ reason : "Use `JsError.RangeError.throwWithMessage` instead" ,
99+ migrate : JsError .RangeError .throwWithMessage (),
100+ })
63101let raiseRangeError : string => 'a
64- @deprecated ("Use `JsError.ReferenceError.throwWithMessage` instead" )
102+ @deprecated ({
103+ reason : "Use `JsError.ReferenceError.throwWithMessage` instead" ,
104+ migrate : JsError .ReferenceError .throwWithMessage (),
105+ })
65106let raiseReferenceError : string => 'a
66- @deprecated ("Use `JsError.SyntaxError.throwWithMessage` instead" )
107+ @deprecated ({
108+ reason : "Use `JsError.SyntaxError.throwWithMessage` instead" ,
109+ migrate : JsError .SyntaxError .throwWithMessage (),
110+ })
67111let raiseSyntaxError : string => 'a
68- @deprecated ("Use `JsError.TypeError.throwWithMessage` instead" )
112+ @deprecated ({
113+ reason : "Use `JsError.TypeError.throwWithMessage` instead" ,
114+ migrate : JsError .TypeError .throwWithMessage (),
115+ })
69116let raiseTypeError : string => 'a
70- @deprecated ("Use `JsError.URIError.throwWithMessage` instead" )
117+ @deprecated ({
118+ reason : "Use `JsError.URIError.throwWithMessage` instead" ,
119+ migrate : JsError .URIError .throwWithMessage (),
120+ })
71121let raiseUriError : string => 'a
72122
73123/**
@@ -76,5 +126,8 @@ let raiseUriError: string => 'a
76126 This helper is useful when you want to discard a value (for example, the result of an operation with side effects)
77127 without having to store or process it further.
78128*/
79- @deprecated ("Use `JsExn.ignore` instead" )
129+ @deprecated ({
130+ reason : "Use `JsExn.ignore` instead" ,
131+ migrate : JsExn .ignore (),
132+ })
80133external ignore : t => unit = "%ignore"
0 commit comments