@tripo3d/lens / index / ErrorPlugin
Class: ErrorPlugin
Defined in: src/plugins/error/index.ts:46
错误监控插件(opt-in 显式装配)。 采集面(ErrorCollectors js/promise/resource + WhiteScreenDetector 白屏)→ 控量 → 分级(remote>local>default)→ 组 ErrorPayload → ctx.emit。 铁律:只 emit 不直发请求、不 import 其它插件、平台必经 L6;受 Consent errors 管控;子类即 event_type,重复折叠靠 L5 内容指纹。
Implements
Constructors
Constructor
ts
new ErrorPlugin(options?): ErrorPlugin;Defined in: src/plugins/error/index.ts:66
Parameters
| Parameter | Type |
|---|---|
options? | ErrorPluginOptions |
Returns
ErrorPlugin
Properties
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
name | readonly | "error" | 'error' | 插件唯一名,重复注册报错 | src/plugins/error/index.ts:47 |
requiredConsent | readonly | "errors" | undefined | 受 Consent errors 维度管控 | src/plugins/error/index.ts:49 |
Methods
setup()
ts
setup(ctx): void;Defined in: src/plugins/error/index.ts:70
注册激活:Core 在 init 时调用
Parameters
| Parameter | Type |
|---|---|
ctx | PluginContext |
Returns
void
Implementation of
teardown()
ts
teardown(): void;Defined in: src/plugins/error/index.ts:145
注销清理:destroy 时调用
Returns
void
Implementation of
captureException()
ts
captureException(error, extras?): void;Defined in: src/plugins/error/index.ts:162
L1 手动捕获异常:归 js(不单列 manual);未 setup 时 no-op
Parameters
| Parameter | Type |
|---|---|
error | unknown |
extras? | Record<string, unknown> |
Returns
void
captureMessage()
ts
captureMessage(message, level?): void;Defined in: src/plugins/error/index.ts:176
L1 手动捕获消息:显式 level 直接定级(level_source='manual',优先于规则引擎),不给则走分级引擎;未 setup 时 no-op
Parameters
| Parameter | Type |
|---|---|
message | string |
level? | ErrorLevel |
Returns
void