Skip to content

Commit cc4d3a1

Browse files
committed
docs(rum): keep Electron app running on SDK failure
1 parent 58ab655 commit cc4d3a1

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

‎en/rum/sdk/electron/advanced-config.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const initialized = await init({
2121
});
2222

2323
if (!initialized) {
24-
app.quit();
24+
console.error('[Flashduty RUM] SDK initialization failed');
2525
}
2626
```
2727

@@ -43,7 +43,7 @@ if (!initialized) {
4343
| `normalizeStackPaths` | `boolean` | No | `true` | Rewrites stack paths under the application directory to stable `app:///` paths |
4444
| `normalizeStackPath` | `(path: string) => string \| undefined` | No | — | Custom mapping for an individual stack frame path |
4545

46-
`init()` returns `false` when validation fails. The SDK prints the reason in the main-process console and does not start collection.
46+
`init()` returns `false` when validation fails. The SDK prints the reason in the main-process console and does not start collection, but it does not prevent the application from starting.
4747

4848
## Custom upload endpoints
4949

‎en/rum/sdk/electron/sdk-integration.mdx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ void app.whenReady().then(async () => {
113113
});
114114

115115
if (!initialized) {
116-
app.quit();
117-
return;
116+
console.error('[Flashduty RUM] SDK initialization failed');
118117
}
119118

120119
createWindow();
@@ -126,7 +125,7 @@ function createWindow(): void {
126125
}
127126
```
128127

129-
`applicationId`, `clientToken`, and `service` are required. Flashduty SaaS users do not need to set `site`.
128+
`applicationId`, `clientToken`, and `service` are required. Flashduty SaaS users do not need to set `site`. Initialization failure does not prevent the application from starting; the SDK logs the specific reason in the main-process console.
130129
</Step>
131130

132131
<Step title="Initialize the renderer SDK">

‎zh/rum/sdk/electron/advanced-config.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const initialized = await init({
2121
});
2222

2323
if (!initialized) {
24-
app.quit();
24+
console.error('[Flashduty RUM] SDK initialization failed');
2525
}
2626
```
2727

@@ -43,7 +43,7 @@ if (!initialized) {
4343
| `normalizeStackPaths` | `boolean` | 否 | `true` | 将应用目录中的错误栈路径归一化为稳定的 `app:///` 路径 |
4444
| `normalizeStackPath` | `(path: string) => string \| undefined` | 否 | — | 自定义单个栈帧的路径映射 |
4545

46-
`init()` 返回 `false` 表示配置校验失败。SDK 会在主进程控制台输出具体原因,并且不会开始采集。
46+
`init()` 返回 `false` 表示配置校验失败。SDK 会在主进程控制台输出具体原因,并且不会开始采集,但不会阻止应用继续启动。
4747

4848
## 自定义上报地址
4949

‎zh/rum/sdk/electron/sdk-integration.mdx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ void app.whenReady().then(async () => {
113113
});
114114

115115
if (!initialized) {
116-
app.quit();
117-
return;
116+
console.error('[Flashduty RUM] SDK initialization failed');
118117
}
119118

120119
createWindow();
@@ -126,7 +125,7 @@ function createWindow(): void {
126125
}
127126
```
128127

129-
`applicationId`、`clientToken` 和 `service` 为必填项。SaaS 用户无需配置 `site`。
128+
`applicationId`、`clientToken` 和 `service` 为必填项。SaaS 用户无需配置 `site`。初始化失败不会阻止应用继续启动;SDK 会在主进程控制台输出具体原因。
130129
</Step>
131130

132131
<Step title="初始化渲染进程 SDK">

0 commit comments

Comments
 (0)