@colisweb/rescript-toolkit 1.31.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
open BsSentryReactNative
|
|
2
|
+
|
|
3
|
+
let error = (loc: ReScriptLogger.Location.t, event) => {
|
|
4
|
+
open Sentry
|
|
5
|
+
withScope(scope => {
|
|
6
|
+
scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
|
|
7
|
+
scope->Scope.setExtra("fullPath", loc.fullPath)
|
|
8
|
+
scope->Scope.setExtra("function", loc.value)
|
|
9
|
+
captureMessage(event)
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let error1 = (loc: ReScriptLogger.Location.t, event, (label, data)) => {
|
|
14
|
+
open Sentry
|
|
15
|
+
withScope(scope => {
|
|
16
|
+
scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
|
|
17
|
+
scope->Scope.setExtra("fullPath", loc.fullPath)
|
|
18
|
+
scope->Scope.setExtra("function", loc.value)
|
|
19
|
+
scope->Scope.setExtra(label, data)
|
|
20
|
+
captureMessage(event)
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let error2 = (loc: ReScriptLogger.Location.t, event, (label1, data1), (label2, data2)) => {
|
|
25
|
+
open Sentry
|
|
26
|
+
withScope(scope => {
|
|
27
|
+
scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
|
|
28
|
+
scope->Scope.setExtra("fullPath", loc.fullPath)
|
|
29
|
+
scope->Scope.setExtra("function", loc.value)
|
|
30
|
+
scope->Scope.setExtra(label1, data1)
|
|
31
|
+
scope->Scope.setExtra(label2, data2)
|
|
32
|
+
captureMessage(event)
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let error3 = (
|
|
37
|
+
loc: ReScriptLogger.Location.t,
|
|
38
|
+
event,
|
|
39
|
+
(label1, data1),
|
|
40
|
+
(label2, data2),
|
|
41
|
+
(label3, data3),
|
|
42
|
+
) => {
|
|
43
|
+
open Sentry
|
|
44
|
+
withScope(scope => {
|
|
45
|
+
scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
|
|
46
|
+
scope->Scope.setExtra("fullPath", loc.fullPath)
|
|
47
|
+
scope->Scope.setExtra("function", loc.value)
|
|
48
|
+
scope->Scope.setExtra(label1, data1)
|
|
49
|
+
scope->Scope.setExtra(label2, data2)
|
|
50
|
+
scope->Scope.setExtra(label3, data3)
|
|
51
|
+
captureMessage(event)
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
let error4 = (
|
|
55
|
+
loc: ReScriptLogger.Location.t,
|
|
56
|
+
event,
|
|
57
|
+
(label1, data1),
|
|
58
|
+
(label2, data2),
|
|
59
|
+
(label3, data3),
|
|
60
|
+
(label4, data4),
|
|
61
|
+
) => {
|
|
62
|
+
open Sentry
|
|
63
|
+
withScope(scope => {
|
|
64
|
+
scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
|
|
65
|
+
scope->Scope.setExtra("fullPath", loc.fullPath)
|
|
66
|
+
scope->Scope.setExtra("function", loc.value)
|
|
67
|
+
scope->Scope.setExtra(label1, data1)
|
|
68
|
+
scope->Scope.setExtra(label2, data2)
|
|
69
|
+
scope->Scope.setExtra(label3, data3)
|
|
70
|
+
scope->Scope.setExtra(label4, data4)
|
|
71
|
+
captureMessage(event)
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
let error5 = (
|
|
75
|
+
loc: ReScriptLogger.Location.t,
|
|
76
|
+
event,
|
|
77
|
+
(label1, data1),
|
|
78
|
+
(label2, data2),
|
|
79
|
+
(label3, data3),
|
|
80
|
+
(label4, data4),
|
|
81
|
+
(label5, data5),
|
|
82
|
+
) => {
|
|
83
|
+
open Sentry
|
|
84
|
+
withScope(scope => {
|
|
85
|
+
scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
|
|
86
|
+
scope->Scope.setExtra("fullPath", loc.fullPath)
|
|
87
|
+
scope->Scope.setExtra("function", loc.value)
|
|
88
|
+
scope->Scope.setExtra(label1, data1)
|
|
89
|
+
scope->Scope.setExtra(label2, data2)
|
|
90
|
+
scope->Scope.setExtra(label3, data3)
|
|
91
|
+
scope->Scope.setExtra(label4, data4)
|
|
92
|
+
scope->Scope.setExtra(label5, data5)
|
|
93
|
+
captureMessage(event)
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
let errorWithData = (loc: ReScriptLogger.Location.t, event, (label, data)) => {
|
|
98
|
+
open Sentry
|
|
99
|
+
withScope(scope => {
|
|
100
|
+
scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
|
|
101
|
+
scope->Scope.setExtra(label, data)
|
|
102
|
+
captureMessage(event)
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let errorWithData2 = (loc: ReScriptLogger.Location.t, event, (label1, data1), (label2, data2)) => {
|
|
107
|
+
open Sentry
|
|
108
|
+
withScope(scope => {
|
|
109
|
+
scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
|
|
110
|
+
scope->Scope.setExtra(label1, data1)
|
|
111
|
+
scope->Scope.setExtra(label2, data2)
|
|
112
|
+
captureMessage(event)
|
|
113
|
+
})
|
|
114
|
+
}
|
|
@@ -2,21 +2,23 @@ module Sentry = {
|
|
|
2
2
|
module Scope = {
|
|
3
3
|
type t
|
|
4
4
|
|
|
5
|
-
@
|
|
5
|
+
@send external setExtra: (t, string, 'a) => unit = "setExtra"
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
@module("
|
|
9
|
-
external init: Js.t<'a> => unit = "init"
|
|
8
|
+
@module("sentry-expo") external init: 'a => unit = "init"
|
|
10
9
|
|
|
11
|
-
@module("
|
|
10
|
+
@module("sentry-expo") @scope("Native")
|
|
12
11
|
external setTag: (string, string) => unit = "setTag"
|
|
13
12
|
|
|
14
|
-
@module("
|
|
13
|
+
@module("sentry-expo") @scope("Native")
|
|
14
|
+
external setUser: 'a => unit = "setUser"
|
|
15
|
+
|
|
16
|
+
@module("sentry-expo") @scope("Native")
|
|
15
17
|
external captureException: Js.Promise.error => unit = "captureException"
|
|
16
18
|
|
|
17
|
-
@module("
|
|
19
|
+
@module("sentry-expo") @scope("Native")
|
|
18
20
|
external captureMessage: string => unit = "captureMessage"
|
|
19
21
|
|
|
20
|
-
@module("
|
|
22
|
+
@module("sentry-expo") @scope("Native")
|
|
21
23
|
external withScope: (Scope.t => unit) => unit = "withScope"
|
|
22
24
|
}
|