-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathCore__Error.res
41 lines (29 loc) · 971 Bytes
/
Core__Error.res
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
type t = Js.Exn.t
external fromException: exn => option<t> = "?as_js_exn"
external toException: t => exn = "%identity"
@get external stack: t => option<string> = "stack"
@get external message: t => option<string> = "message"
@get external name: t => option<string> = "name"
@get external fileName: t => option<string> = "fileName"
@new external make: string => t = "Error"
module EvalError = {
@new external make: string => t = "EvalError"
}
module RangeError = {
@new external make: string => t = "RangeError"
}
module ReferenceError = {
@new external make: string => t = "ReferenceError"
}
module SyntaxError = {
@new external make: string => t = "SyntaxError"
}
module TypeError = {
@new external make: string => t = "TypeError"
}
module URIError = {
@new external make: string => t = "URIError"
}
external raise: t => 'a = "%raise"
let panic = msg => make(`Panic! ${msg}`)->raise
@get_index external getUnsafe: ('a, string) => option<'b> = ""