sentry-uniapp 1.0.11 → 2.8.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/README.md +112 -143
- package/dist/client.d.ts +38 -40
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +46 -38
- package/dist/client.js.map +1 -1
- package/dist/crossPlatform.d.ts +1 -1
- package/dist/crossPlatform.js +11 -10
- package/dist/crossPlatform.js.map +1 -1
- package/dist/eventbuilder.d.ts +9 -10
- package/dist/eventbuilder.d.ts.map +1 -1
- package/dist/eventbuilder.js +131 -58
- package/dist/eventbuilder.js.map +1 -1
- package/dist/flags.js +1 -0
- package/dist/flags.js.map +1 -1
- package/dist/index.d.ts +10 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +84 -21
- package/dist/index.js.map +1 -1
- package/dist/integrations/globalhandlers.d.ts +10 -44
- package/dist/integrations/globalhandlers.d.ts.map +1 -1
- package/dist/integrations/globalhandlers.js +101 -134
- package/dist/integrations/globalhandlers.js.map +1 -1
- package/dist/integrations/ignoreMpcrawlerErrors.d.ts +3 -18
- package/dist/integrations/ignoreMpcrawlerErrors.d.ts.map +1 -1
- package/dist/integrations/ignoreMpcrawlerErrors.js +28 -28
- package/dist/integrations/ignoreMpcrawlerErrors.js.map +1 -1
- package/dist/integrations/index.d.ts +4 -6
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +12 -10
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/router.d.ts +6 -24
- package/dist/integrations/router.d.ts.map +1 -1
- package/dist/integrations/router.js +39 -42
- package/dist/integrations/router.js.map +1 -1
- package/dist/integrations/system.d.ts +5 -16
- package/dist/integrations/system.d.ts.map +1 -1
- package/dist/integrations/system.js +62 -60
- package/dist/integrations/system.js.map +1 -1
- package/dist/parsers.d.ts +2 -2
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js +27 -26
- package/dist/parsers.js.map +1 -1
- package/dist/sdk.d.ts +9 -85
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +55 -129
- package/dist/sdk.js.map +1 -1
- package/dist/tracekit.js +35 -33
- package/dist/tracekit.js.map +1 -1
- package/dist/transport.d.ts +7 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +45 -0
- package/dist/transport.js.map +1 -0
- package/dist/transports/index.d.ts +1 -2
- package/dist/transports/index.d.ts.map +1 -1
- package/dist/transports/index.js +4 -4
- package/dist/transports/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +2 -1
- package/dist/version.js.map +1 -1
- package/esm/client.d.ts +38 -40
- package/esm/client.d.ts.map +1 -1
- package/esm/client.js +43 -37
- package/esm/client.js.map +1 -1
- package/esm/crossPlatform.d.ts +1 -1
- package/esm/crossPlatform.js +10 -10
- package/esm/crossPlatform.js.map +1 -1
- package/esm/eventbuilder.d.ts +9 -10
- package/esm/eventbuilder.d.ts.map +1 -1
- package/esm/eventbuilder.js +125 -52
- package/esm/eventbuilder.js.map +1 -1
- package/esm/flags.js +1 -1
- package/esm/flags.js.map +1 -1
- package/esm/index.d.ts +10 -9
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +13 -8
- package/esm/index.js.map +1 -1
- package/esm/integrations/globalhandlers.d.ts +10 -44
- package/esm/integrations/globalhandlers.d.ts.map +1 -1
- package/esm/integrations/globalhandlers.js +99 -133
- package/esm/integrations/globalhandlers.js.map +1 -1
- package/esm/integrations/ignoreMpcrawlerErrors.d.ts +3 -18
- package/esm/integrations/ignoreMpcrawlerErrors.d.ts.map +1 -1
- package/esm/integrations/ignoreMpcrawlerErrors.js +25 -26
- package/esm/integrations/ignoreMpcrawlerErrors.js.map +1 -1
- package/esm/integrations/index.d.ts +4 -6
- package/esm/integrations/index.d.ts.map +1 -1
- package/esm/integrations/index.js +5 -6
- package/esm/integrations/index.js.map +1 -1
- package/esm/integrations/router.d.ts +6 -24
- package/esm/integrations/router.d.ts.map +1 -1
- package/esm/integrations/router.js +37 -41
- package/esm/integrations/router.js.map +1 -1
- package/esm/integrations/system.d.ts +5 -16
- package/esm/integrations/system.d.ts.map +1 -1
- package/esm/integrations/system.js +60 -59
- package/esm/integrations/system.js.map +1 -1
- package/esm/parsers.d.ts +2 -2
- package/esm/parsers.d.ts.map +1 -1
- package/esm/parsers.js +20 -19
- package/esm/parsers.js.map +1 -1
- package/esm/sdk.d.ts +9 -85
- package/esm/sdk.d.ts.map +1 -1
- package/esm/sdk.js +49 -122
- package/esm/sdk.js.map +1 -1
- package/esm/tracekit.js +33 -31
- package/esm/tracekit.js.map +1 -1
- package/esm/transport.d.ts +7 -0
- package/esm/transport.d.ts.map +1 -0
- package/esm/transport.js +41 -0
- package/esm/transport.js.map +1 -0
- package/esm/transports/index.d.ts +1 -2
- package/esm/transports/index.d.ts.map +1 -1
- package/esm/transports/index.js +1 -2
- package/esm/transports/index.js.map +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.d.ts.map +1 -1
- package/esm/version.js +2 -2
- package/esm/version.js.map +1 -1
- package/package.json +24 -28
- package/dist/backend.d.ts +0 -41
- package/dist/backend.d.ts.map +0 -1
- package/dist/backend.js +0 -68
- package/dist/backend.js.map +0 -1
- package/dist/helpers.d.ts +0 -35
- package/dist/helpers.d.ts.map +0 -1
- package/dist/helpers.js +0 -236
- package/dist/helpers.js.map +0 -1
- package/dist/integrations/linkederrors.d.ts +0 -40
- package/dist/integrations/linkederrors.d.ts.map +0 -1
- package/dist/integrations/linkederrors.js +0 -65
- package/dist/integrations/linkederrors.js.map +0 -1
- package/dist/integrations/trycatch.d.ts +0 -26
- package/dist/integrations/trycatch.d.ts.map +0 -1
- package/dist/integrations/trycatch.js +0 -166
- package/dist/integrations/trycatch.js.map +0 -1
- package/dist/sentry-uniapp.min.js +0 -17
- package/dist/sentry-uniapp.min.js.map +0 -1
- package/dist/transports/base.d.ts +0 -22
- package/dist/transports/base.d.ts.map +0 -1
- package/dist/transports/base.js +0 -28
- package/dist/transports/base.js.map +0 -1
- package/dist/transports/xhr.d.ts +0 -10
- package/dist/transports/xhr.d.ts.map +0 -1
- package/dist/transports/xhr.js +0 -42
- package/dist/transports/xhr.js.map +0 -1
- package/esm/backend.d.ts +0 -41
- package/esm/backend.d.ts.map +0 -1
- package/esm/backend.js +0 -66
- package/esm/backend.js.map +0 -1
- package/esm/helpers.d.ts +0 -35
- package/esm/helpers.d.ts.map +0 -1
- package/esm/helpers.js +0 -229
- package/esm/helpers.js.map +0 -1
- package/esm/integrations/linkederrors.d.ts +0 -40
- package/esm/integrations/linkederrors.d.ts.map +0 -1
- package/esm/integrations/linkederrors.js +0 -63
- package/esm/integrations/linkederrors.js.map +0 -1
- package/esm/integrations/trycatch.d.ts +0 -26
- package/esm/integrations/trycatch.d.ts.map +0 -1
- package/esm/integrations/trycatch.js +0 -164
- package/esm/integrations/trycatch.js.map +0 -1
- package/esm/transports/base.d.ts +0 -22
- package/esm/transports/base.d.ts.map +0 -1
- package/esm/transports/base.js +0 -26
- package/esm/transports/base.js.map +0 -1
- package/esm/transports/xhr.d.ts +0 -10
- package/esm/transports/xhr.d.ts.map +0 -1
- package/esm/transports/xhr.js +0 -40
- package/esm/transports/xhr.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,86 +1,68 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sentry Uniapp SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`sentry Uniapp SDK` 的封装,可用于 Uniapp 全端,包含app, h5,微信小程序,抖音小程序,百度小程序等各家平台。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
同时支持 Uniapp vue2 / vue3 工程。
|
|
6
|
+
|
|
7
|
+
> 提示:由于快应用 require 方式特殊性,webpack是在编译期处理的,动态代码检测无效,所以单独维护,包名为 sentry-quickapp。
|
|
6
8
|
|
|
7
9
|
快应用项目可参考:
|
|
8
10
|
|
|
9
11
|
<https://github.com/uappkit/sentry-quickapp>
|
|
10
12
|
|
|
11
|
-
## 功能特点
|
|
12
|
-
|
|
13
|
-
- [x] 基于 [sentry-javascript 最新的基础模块](https://www.yuque.com/lizhiyao/dxy/zevhf1#0GMCN) 封装
|
|
14
|
-
- [x] 遵守[官方统一的 API 设计文档](https://www.yuque.com/lizhiyao/dxy/gc3b9r#vQdTs),使用方式和官方保持一致
|
|
15
|
-
- [x] 使用 [TypeScript](https://www.typescriptlang.org/) 进行编写
|
|
16
|
-
- [x] 包含 Sentry SDK(如:[@sentry/browser](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser))的所有基础功能
|
|
17
|
-
- [x] 支持 `ES6`、`CommonJS` 两种模块系统(支持小程序原生开发方式、使用小程序框架开发方式两种开发模式下使用)
|
|
18
|
-
- [x] 默认监听并上报小程序的 onError、onUnhandledRejection、onPageNotFound、onMemoryWarning 事件返回的信息(各事件支持程度与对应各小程序官方保持一致)
|
|
19
|
-
- [x] 默认上报运行小程序的设备、操作系统、应用版本信息
|
|
20
|
-
- [x] 支持微信小程序
|
|
21
|
-
- [x] 支持微信小游戏
|
|
22
|
-
- [x] 支持字节跳动小程序
|
|
23
|
-
- [x] 支持支付宝小程序
|
|
24
|
-
- [x] 支持钉钉小程序
|
|
25
|
-
- [x] 支持百度小程序
|
|
26
|
-
- [x] 支持快应用
|
|
27
|
-
- [x] 支持在 [Taro](https://taro.aotu.io/) 等第三方小程序框架中使用
|
|
28
|
-
- [x] 默认上报异常发生时的路由栈
|
|
29
|
-
- [ ] 完善的代码测试
|
|
30
|
-
|
|
31
13
|
## 用法
|
|
32
14
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- 直接引用
|
|
36
|
-
- 通过 npm 方式使用(推荐)
|
|
37
|
-
|
|
38
|
-
### 注意
|
|
39
|
-
|
|
40
|
-
1. 无论选择哪种使用方式,都需要开启「微信开发者工具 - 设置 - 项目设置 - 增强编译」功能
|
|
41
|
-
2. 使用前需要确保有可用的 `Sentry Service`,比如:使用 [官方 Sentry Service](https://sentry.io/welcome/) 服务 或[自己搭建 Sentry Service](https://docs.sentry.io/server/)。如果想直接将异常信息上报到 <https://sentry.io/>,由于其没有备案,可以先将异常信息上报给自己已备案域名下的服务端接口,由服务端进行请求转发。
|
|
42
|
-
3. 在小程序管理后台配置 `Sentry Service` 对应的 `request` 合法域名
|
|
43
|
-
|
|
44
|
-
### 直接引用
|
|
45
|
-
|
|
46
|
-
1. 微信小程序和微信小游戏下载 [sentry-uniapp.wx.min.js](https://github.com/uappkit/sentry-uniapp/blob/master/examples/weapp/vendor/sentry-uniapp.wx.min.js);字节跳动小程序下载 [sentry-uniapp.tt.min.js](https://github.com/uappkit/sentry-uniapp/blob/master/examples/ttapp/vendor/sentry-uniapp.tt.min.js);支付宝小程序下载 [sentry-uniapp.my.min.js](https://github.com/uappkit/sentry-uniapp/blob/master/examples/myapp/vendor/sentry-uniapp.my.min.js),钉钉小程序下载 [sentry-uniapp.dd.min.js](https://github.com/uappkit/sentry-uniapp/blob/master/examples/ddapp/vendor/sentry-uniapp.dd.min.js)
|
|
47
|
-
2. 参照 `/examples` 中各项目使用方式,将 `sentry-uniapp.xx.min.js` 放入项目的合适目录中,比如放入 `vendor` 文件夹
|
|
48
|
-
3. 参照 `/examples/app.js` 代码,进行 `Sentry` 的初始化
|
|
49
|
-
4. 对于提供了微信、字节跳动小程序 `sentry-uniapp` 会自动上报 `xx.onError()` 捕获的异常,对于支付宝小程序需要应用开发者在 `App.onError()` 中主动进行异常上报。详情可见 `/docs/cross-platform.md`。
|
|
50
|
-
|
|
51
|
-
### npm 方式
|
|
15
|
+
1、安装依赖
|
|
52
16
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
npm install sentry-uniapp --save
|
|
59
|
-
# 或者
|
|
60
|
-
yarn add sentry-uniapp
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
2. 使用「微信开发者工具 - 工具 - 构建 npm」进行构建,详情可参考[npm 支持](https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html)
|
|
64
|
-
|
|
65
|
-
3. 在 `app.js` 中引用并初始化 `Sentry`,根据实际需求设置上报到 Sentry 的元信息
|
|
17
|
+
```bash
|
|
18
|
+
npm install sentry-uniapp
|
|
19
|
+
```
|
|
66
20
|
|
|
67
|
-
|
|
68
|
-
|
|
21
|
+
2、在 `App.vue => onLaunch` 中初始化
|
|
22
|
+
|
|
23
|
+
注意替换下方代码里的 `__DSN__`,并仔细阅读注释说明和常见问题
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
export default {
|
|
27
|
+
onLaunch: function () {
|
|
28
|
+
console.log('App Launch');
|
|
29
|
+
sentry.init({
|
|
30
|
+
// __DSN__ 参考格式: https://8137b89b2d1c4e349da3a38dca80c5fe@sentry.io/1
|
|
31
|
+
dsn: '__DSN__',
|
|
32
|
+
|
|
33
|
+
// extraOptions 主要是解决平台差异问题的,见下方说明
|
|
34
|
+
// 非 APP 平台,可以不用
|
|
35
|
+
extraOptions: { onmemorywarning: false, onerror: false }
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// 代码上报,extra 为可选的自定义对象内容
|
|
39
|
+
sentry.captureMessage('custom message from ' + uni.getSystemInfoSync().platform, {
|
|
40
|
+
UserId: 123,
|
|
41
|
+
Command: 'npm i -g uapp'
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// 触发一个未定义函数的错误
|
|
45
|
+
balabala();
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
// sentry-uniapp 内部是通过 uni.onError 钩子函数捕获错误的
|
|
49
|
+
// 但目前 uni.onError 暂不支持 App (android / ios),各平台支持情况参考:
|
|
50
|
+
// https://uniapp.dcloud.net.cn/api/application.html#onerror
|
|
51
|
+
//
|
|
52
|
+
// 通用方案:
|
|
53
|
+
// 可用 App.onError 自己处理,但需要先禁用 sentry 里的捕获
|
|
54
|
+
// 方法在 sentry.init 参数里加上 extraOptions: { onerror: false }
|
|
55
|
+
onError: function (e) {
|
|
56
|
+
sentry.captureException(e);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
69
60
|
|
|
70
|
-
|
|
71
|
-
// init options: https://github.com/getsentry/sentry-javascript/blob/master/packages/types/src/options.ts
|
|
72
|
-
// extraOptions 可以禁用哪些监听事件,定义见: GlobalHandlersIntegrations
|
|
73
|
-
// 例如出现 LOG: API `onMemoryWarning` is not yet implemented,可通过 `onmemorywarning: false` 关闭
|
|
74
|
-
Sentry.init({
|
|
75
|
-
dsn: "__DSN__",
|
|
76
|
-
extraOptions: {
|
|
77
|
-
onmemorywarning: false,
|
|
78
|
-
},
|
|
79
|
-
// ...
|
|
80
|
-
});
|
|
61
|
+
3、其他可选配置
|
|
81
62
|
|
|
63
|
+
```js
|
|
82
64
|
// Set user information, as well as tags and further extras
|
|
83
|
-
|
|
65
|
+
sentry.configureScope((scope) => {
|
|
84
66
|
scope.setExtra("battery", 0.7);
|
|
85
67
|
scope.setTag("user_mode", "admin");
|
|
86
68
|
scope.setUser({ id: "4711" });
|
|
@@ -88,124 +70,111 @@ Sentry SDK 的封装,可用于Uniapp全端,及微信小程序,抖音小程
|
|
|
88
70
|
});
|
|
89
71
|
|
|
90
72
|
// Add a breadcrumb for future events
|
|
91
|
-
|
|
73
|
+
sentry.addBreadcrumb({
|
|
92
74
|
message: "My Breadcrumb",
|
|
93
75
|
// ...
|
|
94
76
|
});
|
|
95
77
|
|
|
96
78
|
// Capture exceptions, messages or manual events
|
|
97
79
|
// Error 无法定义标题,可以用下面的 captureMessage
|
|
98
|
-
|
|
80
|
+
sentry.captureException(new Error("Good bye"));
|
|
99
81
|
|
|
100
|
-
// captureMessage
|
|
101
|
-
|
|
102
|
-
Sentry.captureMessage("message title", {
|
|
82
|
+
// captureMessage 可以定制消息标题,extra 为附加的对象内容
|
|
83
|
+
sentry.captureMessage("message title", {
|
|
103
84
|
extra
|
|
104
85
|
});
|
|
105
86
|
|
|
106
|
-
|
|
87
|
+
sentry.captureEvent({
|
|
107
88
|
message: "Manual",
|
|
108
89
|
stacktrace: [
|
|
109
90
|
// ...
|
|
110
91
|
],
|
|
111
92
|
});
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
## 开发
|
|
115
|
-
|
|
116
|
-
### 知识储备
|
|
117
|
-
|
|
118
|
-
开发前请仔细阅读下面内容:
|
|
93
|
+
```
|
|
119
94
|
|
|
120
|
-
|
|
121
|
-
- [Sentry 开发指南](https://www.yuque.com/lizhiyao/dxydance/sentry-develop-guide)
|
|
122
|
-
- [sentry-javascript 源码阅读](https://www.yuque.com/lizhiyao/dxydance/sentry-javascript-src)
|
|
95
|
+
## 参考示例
|
|
123
96
|
|
|
124
|
-
|
|
97
|
+
项目代码里的 `uapp-demo`,通过 HBuilderX 打开即可,下面截图为 `uapp-demo` 在各平台测试结果。
|
|
125
98
|
|
|
126
|
-

|
|
127
100
|
|
|
128
|
-
|
|
101
|
+
## 常见问题
|
|
129
102
|
|
|
130
|
-
|
|
103
|
+
1、大多数本地环境问题,成功安装后,目录结构如下图:
|
|
131
104
|
|
|
132
|
-
|
|
105
|
+

|
|
133
106
|
|
|
134
|
-
|
|
107
|
+
先通过 sentry.captureMessage 确认能上报成功,如果收不到,
|
|
135
108
|
|
|
136
|
-
|
|
109
|
+
* 可检测 `__DSN__` 是否正确
|
|
110
|
+
* 检测网络,最好通过配置代理拦截下网络请求是否存在
|
|
137
111
|
|
|
138
|
-
|
|
139
|
-
# 根据 package.json 中的版本号更新 SDK 源码中的版本号
|
|
140
|
-
npm run version
|
|
112
|
+
2、提示 onmemorywarning 未实现错误
|
|
141
113
|
|
|
142
|
-
|
|
143
|
-
npm run build:dist
|
|
114
|
+
> API `onMemoryWarning` is not yet implemented __ERROR
|
|
144
115
|
|
|
145
|
-
|
|
146
|
-
npm run build
|
|
116
|
+
有的平台不支持 `memorywarning` 的监听,可以 sentry.init 里禁用:
|
|
147
117
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
118
|
+
```.js
|
|
119
|
+
sentry.init({
|
|
120
|
+
dsn: '__DSN__',
|
|
121
|
+
extraOptions: { onmemorywarning: false }
|
|
122
|
+
});
|
|
153
123
|
```
|
|
154
124
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-

|
|
158
|
-

|
|
159
|
-

|
|
160
|
-

|
|
161
|
-
|
|
162
|
-
## 谁在使用 sentry-uniapp
|
|
125
|
+
3、暂不支持 sentry.init 开启 debug,移除 或设置 false
|
|
163
126
|
|
|
164
|
-
|
|
127
|
+
> [Vue warn]: Error in onLaunch hook: "TypeError: undefined is not an object (evaluating '(_a = global.console)[name]')"[ERROR] : [Vue warn]: Error in onLaunch hook: "TypeError: undefined is not an object (evaluating '(_a = global.console)[name]')"(found at App.vue:1) __ERROR
|
|
165
128
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
- 丁香医生
|
|
174
|
-
|
|
175
|
-
### 字节跳动小程序
|
|
129
|
+
```.js
|
|
130
|
+
sentry.init({
|
|
131
|
+
dsn: '__DSN__',
|
|
132
|
+
debug: false,
|
|
133
|
+
});
|
|
134
|
+
```
|
|
176
135
|
|
|
177
|
-
|
|
136
|
+
4、代码异常没有自动上报的,可查看 HBuilderX 的 log 窗口,区分以下两种错误情况
|
|
178
137
|
|
|
179
|
-
|
|
138
|
+
[JS Framework] 开头,由 framewrok 底层拦截 `不会触发 sentry 上报`,错误信息如下:
|
|
180
139
|
|
|
181
|
-
|
|
182
|
-
- [Sentry Getting Started](https://docs.sentry.io/error-reporting/quickstart/?platform=browsernpm)
|
|
183
|
-
- [Sentry JavaScript SDKs](http://getsentry.github.io/sentry-javascript/)
|
|
184
|
-
- [Sentry TypeScript Configuration](https://github.com/getsentry/sentry-javascript/tree/master/packages/typescript)
|
|
185
|
-
- [wx.request](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html)
|
|
186
|
-
- [小程序 App](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html)
|
|
187
|
-
- [wx.onError、App.onError 疑惑及如何捕获 Promise 异常?](https://developers.weixin.qq.com/community/develop/doc/000c8cf5794770272709f38a756000)
|
|
188
|
-
- [shields.io](https://shields.io/)
|
|
189
|
-
- [字节跳动小程序文档](https://developer.toutiao.com/docs/framework/)
|
|
190
|
-
- [支付宝小程序文档](https://docs.alipay.com/mini/developer)
|
|
191
|
-
- [tt.onError 的疑问](http://forum.microapp.bytedance.com/topic/2806/tt-onerror-%E7%96%91%E9%97%AE)
|
|
140
|
+
> [JS Framework] Failed to execute the callback function:[ERROR] : [JS Framework] Failed to execute the callback function:ReferenceError: Can't find variable: balabala __ERROR
|
|
192
141
|
|
|
193
|
-
|
|
142
|
+
Vue 层报的错误,可以触发 sentry 上报,错误信息如下:
|
|
194
143
|
|
|
195
|
-
|
|
196
|
-
- [FrontJS](https://www.frontjs.com/home/tour)
|
|
197
|
-
- [Bugout](https://bugout.testin.cn/)
|
|
144
|
+
> [Vue warn]: Error in onLaunch hook: "ReferenceError: Can't find variable: balabala"[ERROR] : [Vue warn]: Error in onLaunch hook: "ReferenceError: Can't find variable: balabala"(found at App.vue:1) __ERROR
|
|
198
145
|
|
|
199
|
-
##
|
|
146
|
+
## 功能特点
|
|
200
147
|
|
|
201
|
-
|
|
148
|
+
- [x] 基于 [sentry-javascript 最新的基础模块](https://www.yuque.com/lizhiyao/dxy/zevhf1#0GMCN) 封装
|
|
149
|
+
- [x] 遵守[官方统一的 API 设计文档](https://www.yuque.com/lizhiyao/dxy/gc3b9r#vQdTs),使用方式和官方保持一致
|
|
150
|
+
- [x] 使用 [TypeScript](https://www.typescriptlang.org/) 进行编写
|
|
151
|
+
- [x] 包含 Sentry SDK(如:[@sentry/browser](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser))的所有基础功能
|
|
152
|
+
- [x] 支持 `ES6`、`CommonJS` 两种模块系统(支持小程序原生开发方式、使用小程序框架开发方式两种开发模式下使用)
|
|
153
|
+
- [x] 默认监听并上报小程序的 onError、onUnhandledRejection、onPageNotFound、onMemoryWarning 事件返回的信息(各事件支持程度与对应各小程序官方保持一致)
|
|
154
|
+
- [x] 默认上报运行小程序的设备、操作系统、应用版本信息
|
|
155
|
+
- [x] 支持微信小程序
|
|
156
|
+
- [x] 支持微信小游戏
|
|
157
|
+
- [x] 支持字节跳动小程序
|
|
158
|
+
- [x] 支持支付宝小程序
|
|
159
|
+
- [x] 支持钉钉小程序
|
|
160
|
+
- [x] 支持百度小程序
|
|
161
|
+
- [x] 支持快应用
|
|
162
|
+
- [x] 支持在 [Taro](https://taro.aotu.io/) 等第三方小程序框架中使用
|
|
163
|
+
- [x] 默认上报异常发生时的路由栈
|
|
164
|
+
- [ ] 完善的代码测试
|
|
202
165
|
|
|
203
166
|
## 感谢
|
|
204
167
|
|
|
205
|
-
|
|
168
|
+
本项目基于下面开源基础上修改,感谢原作者:
|
|
206
169
|
|
|
207
170
|
<https://github.com/lizhiyao/sentry-miniapp>
|
|
208
171
|
|
|
209
172
|
## 联系作者
|
|
210
173
|
|
|
211
174
|
微信: yinqisen
|
|
175
|
+
|
|
176
|
+
推荐另一个开源作品 `uapp`, 方便 Uniapp 离线打包的 cli。
|
|
177
|
+
|
|
178
|
+
<https://github.com/uappkit/uapp>
|
|
179
|
+
|
|
180
|
+

|
package/dist/client.d.ts
CHANGED
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
import { BaseClient
|
|
2
|
-
import {
|
|
3
|
-
import { MiniappBackend, MiniappOptions } from "./backend";
|
|
1
|
+
import { BaseClient } from '@sentry/core';
|
|
2
|
+
import type { ClientOptions, Event, EventHint, Scope, SeverityLevel } from '@sentry/core';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Configuration options for the Uniapp SDK.
|
|
6
5
|
*/
|
|
7
|
-
export interface
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
export interface UniappOptions extends ClientOptions {
|
|
7
|
+
/**
|
|
8
|
+
* List of URLs to allow for error tracking.
|
|
9
|
+
*/
|
|
10
|
+
allowUrls?: Array<string | RegExp>;
|
|
11
|
+
/**
|
|
12
|
+
* List of URLs to deny for error tracking.
|
|
13
|
+
*/
|
|
14
|
+
denyUrls?: Array<string | RegExp>;
|
|
15
|
+
/**
|
|
16
|
+
* Extra options for global handlers integration
|
|
17
|
+
*/
|
|
18
|
+
extraOptions?: {
|
|
19
|
+
onerror?: boolean;
|
|
20
|
+
onunhandledrejection?: boolean;
|
|
21
|
+
onpagenotfound?: boolean;
|
|
22
|
+
onmemorywarning?: boolean;
|
|
14
23
|
};
|
|
15
|
-
lang?: string;
|
|
16
|
-
title?: string;
|
|
17
|
-
subtitle?: string;
|
|
18
|
-
subtitle2?: string;
|
|
19
|
-
labelName?: string;
|
|
20
|
-
labelEmail?: string;
|
|
21
|
-
labelComments?: string;
|
|
22
|
-
labelClose?: string;
|
|
23
|
-
labelSubmit?: string;
|
|
24
|
-
errorGeneric?: string;
|
|
25
|
-
errorFormEntry?: string;
|
|
26
|
-
successMessage?: string;
|
|
27
|
-
/** Callback after reportDialog showed up */
|
|
28
|
-
onLoad?(): void;
|
|
29
24
|
}
|
|
30
25
|
/**
|
|
31
|
-
* The Sentry
|
|
32
|
-
*
|
|
33
|
-
* @see MiniappOptions for documentation on configuration options.
|
|
34
|
-
* @see SentryClient for usage documentation.
|
|
26
|
+
* The Sentry Uniapp SDK Client.
|
|
35
27
|
*/
|
|
36
|
-
export declare class
|
|
28
|
+
export declare class UniappClient extends BaseClient<UniappOptions> {
|
|
37
29
|
/**
|
|
38
|
-
* Creates a new
|
|
39
|
-
*
|
|
40
|
-
* @param options Configuration options for this SDK.
|
|
30
|
+
* Creates a new Uniapp SDK instance.
|
|
41
31
|
*/
|
|
42
|
-
constructor(options
|
|
32
|
+
constructor(options: UniappOptions);
|
|
43
33
|
/**
|
|
44
34
|
* @inheritDoc
|
|
45
35
|
*/
|
|
46
|
-
protected _prepareEvent(event: Event,
|
|
36
|
+
protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null>;
|
|
47
37
|
/**
|
|
48
|
-
*
|
|
49
|
-
* 向用户显示报告对话框以将反馈发送到特定事件。---> 小程序上暂时用不到&不考虑。
|
|
50
|
-
*
|
|
51
|
-
* @param options Set individual options for the dialog
|
|
38
|
+
* Create an event from an exception.
|
|
52
39
|
*/
|
|
53
|
-
|
|
40
|
+
eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;
|
|
41
|
+
/**
|
|
42
|
+
* Create an event from a message.
|
|
43
|
+
*/
|
|
44
|
+
eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Options for showing the report dialog (not supported in miniapp environment)
|
|
48
|
+
*/
|
|
49
|
+
export interface ReportDialogOptions {
|
|
50
|
+
eventId?: string;
|
|
51
|
+
[key: string]: any;
|
|
54
52
|
}
|
|
55
53
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAM1F;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAElC;;OAEG;IACH,YAAY,CAAC,EAAE;QACb,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,UAAU,CAAC,aAAa,CAAC;IACzD;;OAEG;gBACgB,OAAO,EAAE,aAAa;IAUzC;;OAEG;IACH,SAAS,CAAC,aAAa,CACrB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,KAAK,GACZ,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC;IAgB5B;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAI/E;;OAEG;IACI,gBAAgB,CACrB,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,aAAsB,EAC7B,IAAI,CAAC,EAAE,SAAS,GACf,WAAW,CAAC,KAAK,CAAC;CAGtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
|
package/dist/client.js
CHANGED
|
@@ -1,51 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
exports.UniappClient = void 0;
|
|
4
|
+
// logger is not exported from core in v8, stays in utils or needs check
|
|
5
|
+
// But based on user request, let's check other files.
|
|
6
|
+
// Actually, logger IS internal in v8 usually. Let's keep it if not deprecated or check specifically.
|
|
7
|
+
// User specifically mentioned extractExceptionKeysForMessage, isEvent, normalizeToSize.
|
|
8
|
+
// Let's stick to those for now, and check if logger is deprecated.
|
|
9
|
+
const core_1 = require("@sentry/core");
|
|
10
|
+
const eventbuilder_1 = require("./eventbuilder");
|
|
11
|
+
const transport_1 = require("./transport");
|
|
12
|
+
const version_1 = require("./version");
|
|
7
13
|
/**
|
|
8
|
-
* The Sentry
|
|
9
|
-
*
|
|
10
|
-
* @see MiniappOptions for documentation on configuration options.
|
|
11
|
-
* @see SentryClient for usage documentation.
|
|
14
|
+
* The Sentry Uniapp SDK Client.
|
|
12
15
|
*/
|
|
13
|
-
|
|
14
|
-
tslib_1.__extends(MiniappClient, _super);
|
|
16
|
+
class UniappClient extends core_1.BaseClient {
|
|
15
17
|
/**
|
|
16
|
-
* Creates a new
|
|
17
|
-
*
|
|
18
|
-
* @param options Configuration options for this SDK.
|
|
18
|
+
* Creates a new Uniapp SDK instance.
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
constructor(options) {
|
|
21
|
+
// Set default transport if not provided
|
|
22
|
+
const clientOptions = {
|
|
23
|
+
transport: transport_1.makeUniappTransport,
|
|
24
|
+
...options,
|
|
25
|
+
};
|
|
26
|
+
super(clientOptions);
|
|
23
27
|
}
|
|
24
28
|
/**
|
|
25
29
|
* @inheritDoc
|
|
26
30
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
event.sdk =
|
|
31
|
+
_prepareEvent(event, hint, scope) {
|
|
32
|
+
// Set SDK info
|
|
33
|
+
event.sdk = {
|
|
34
|
+
name: version_1.SDK_NAME,
|
|
35
|
+
packages: [
|
|
30
36
|
{
|
|
31
|
-
name:
|
|
32
|
-
version: version_1.SDK_VERSION
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
name: 'npm:sentry-uniapp',
|
|
38
|
+
version: version_1.SDK_VERSION,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
version: version_1.SDK_VERSION,
|
|
42
|
+
};
|
|
43
|
+
return super._prepareEvent(event, hint, scope);
|
|
44
|
+
}
|
|
37
45
|
/**
|
|
38
|
-
*
|
|
39
|
-
* 向用户显示报告对话框以将反馈发送到特定事件。---> 小程序上暂时用不到&不考虑。
|
|
40
|
-
*
|
|
41
|
-
* @param options Set individual options for the dialog
|
|
46
|
+
* Create an event from an exception.
|
|
42
47
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
eventFromException(exception, hint) {
|
|
49
|
+
return Promise.resolve((0, eventbuilder_1.eventFromException)(exception, hint));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create an event from a message.
|
|
53
|
+
*/
|
|
54
|
+
eventFromMessage(message, level = 'info', hint) {
|
|
55
|
+
return Promise.resolve((0, eventbuilder_1.eventFromMessage)(message, level, hint));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.UniappClient = UniappClient;
|
|
51
59
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AACxE,uDAAuD;AACvD,qGAAqG;AACrG,wFAAwF;AACxF,mEAAmE;AACnE,uCAA0C;AAG1C,iDAAsE;AACtE,2CAAkD;AAClD,uCAAkD;AA2BlD;;GAEG;AACH,MAAa,YAAa,SAAQ,iBAAyB;IACzD;;OAEG;IACH,YAAmB,OAAsB;QACvC,wCAAwC;QACxC,MAAM,aAAa,GAAkB;YACnC,SAAS,EAAE,+BAAmB;YAC9B,GAAG,OAAO;SACX,CAAC;QAEF,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED;;OAEG;IACO,aAAa,CACrB,KAAY,EACZ,IAAe,EACf,KAAa;QAEb,eAAe;QACf,KAAK,CAAC,GAAG,GAAG;YACV,IAAI,EAAE,kBAAQ;YACd,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE,qBAAW;iBACrB;aACF;YACD,OAAO,EAAE,qBAAW;SACrB,CAAC;QAEF,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACI,kBAAkB,CAAC,SAAc,EAAE,IAAgB;QACxD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,iCAAkB,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,gBAAgB,CACrB,OAAe,EACf,QAAuB,MAAM,EAC7B,IAAgB;QAEhB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,+BAAgB,EAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC;CACF;AAtDD,oCAsDC"}
|
package/dist/crossPlatform.d.ts
CHANGED
|
@@ -13,6 +13,6 @@ interface SDK {
|
|
|
13
13
|
getLaunchOptionsSync?: Function;
|
|
14
14
|
}
|
|
15
15
|
declare const sdk: SDK;
|
|
16
|
-
declare const appName: "
|
|
16
|
+
declare const appName: "uniapp" | "wechat" | "alipay" | "bytedance" | "dingtalk" | "qq" | "swan" | "unknown";
|
|
17
17
|
export { sdk, appName };
|
|
18
18
|
//# sourceMappingURL=crossPlatform.d.ts.map
|
package/dist/crossPlatform.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
3
|
exports.appName = exports.sdk = void 0;
|
|
3
|
-
|
|
4
|
+
let currentSdk = {
|
|
4
5
|
// tslint:disable-next-line: no-empty
|
|
5
|
-
request:
|
|
6
|
+
request: () => {
|
|
6
7
|
},
|
|
7
8
|
// tslint:disable-next-line: no-empty
|
|
8
|
-
httpRequest:
|
|
9
|
+
httpRequest: () => {
|
|
9
10
|
},
|
|
10
11
|
// tslint:disable-next-line: no-empty
|
|
11
|
-
getSystemInfoSync:
|
|
12
|
+
getSystemInfoSync: () => {
|
|
12
13
|
},
|
|
13
14
|
// tslint:disable-next-line: no-empty
|
|
14
|
-
getSystemInfo:
|
|
15
|
+
getSystemInfo: () => {
|
|
15
16
|
},
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* 获取跨平台的 SDK
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
const getSDK = () => {
|
|
21
22
|
if (typeof uni === "object") {
|
|
22
23
|
currentSdk = uni;
|
|
23
24
|
}
|
|
@@ -48,8 +49,8 @@ var getSDK = function () {
|
|
|
48
49
|
/**
|
|
49
50
|
* 获取平台名称
|
|
50
51
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
const getAppName = () => {
|
|
53
|
+
let currentAppName = "unknown";
|
|
53
54
|
if (typeof uni === "object") {
|
|
54
55
|
currentAppName = "uniapp";
|
|
55
56
|
}
|
|
@@ -73,8 +74,8 @@ var getAppName = function () {
|
|
|
73
74
|
}
|
|
74
75
|
return currentAppName;
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
+
const sdk = getSDK();
|
|
77
78
|
exports.sdk = sdk;
|
|
78
|
-
|
|
79
|
+
const appName = getAppName();
|
|
79
80
|
exports.appName = appName;
|
|
80
81
|
//# sourceMappingURL=crossPlatform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crossPlatform.js","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crossPlatform.js","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":";;;AAqCA,IAAI,UAAU,GAAQ;IACpB,qCAAqC;IACrC,OAAO,EAAE,GAAG,EAAE;IACd,CAAC;IACD,qCAAqC;IACrC,WAAW,EAAE,GAAG,EAAE;IAClB,CAAC;IACD,qCAAqC;IACrC,iBAAiB,EAAE,GAAG,EAAE;IACxB,CAAC;IACD,qCAAqC;IACrC,aAAa,EAAE,GAAG,EAAE;IACpB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,EAAE;IAClB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,UAAU,GAAG,GAAG,CAAC;IACnB,CAAC;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAClC,UAAU,GAAG,EAAE,CAAC;IAClB,CAAC;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAClC,UAAU,GAAG,EAAE,CAAC;IAClB,CAAC;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAClC,UAAU,GAAG,EAAE,CAAC;IAClB,CAAC;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAClC,UAAU,GAAG,EAAE,CAAC;IAClB,CAAC;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAClC,UAAU,GAAG,EAAE,CAAC;IAClB,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,UAAU,GAAG,IAAI,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,GAAG,GAAG,EAAE;IACtB,IAAI,cAAc,GAAY,SAAS,CAAC;IAExC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,cAAc,GAAG,QAAQ,CAAC;IAC5B,CAAC;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAClC,cAAc,GAAG,QAAQ,CAAC;IAC5B,CAAC;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAClC,cAAc,GAAG,QAAQ,CAAC;IAC5B,CAAC;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAClC,cAAc,GAAG,WAAW,CAAC;IAC/B,CAAC;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAClC,cAAc,GAAG,UAAU,CAAC;IAC9B,CAAC;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAClC,cAAc,GAAG,IAAI,CAAC;IACxB,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,cAAc,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;AAGb,kBAAG;AAFX,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAEhB,0BAAO"}
|
package/dist/eventbuilder.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Event } from '@sentry/
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}): Event;
|
|
1
|
+
import type { Event, EventHint, SeverityLevel } from '@sentry/core';
|
|
2
|
+
/**
|
|
3
|
+
* Builds an Event from an Exception
|
|
4
|
+
*/
|
|
5
|
+
export declare function eventFromException(exception: unknown, hint?: EventHint): Event;
|
|
6
|
+
/**
|
|
7
|
+
* Builds an Event from a Message
|
|
8
|
+
*/
|
|
9
|
+
export declare function eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): Event;
|
|
11
10
|
//# sourceMappingURL=eventbuilder.d.ts.map
|