Cannot reference postMessage id on error in web workers
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 13.7k
- 派生
- 1.1k
- PR 合并指标
- 30 天内没有已合并 PR
描述
Perhaps I am just missing it, but there doesn't seem to be a way to trace an error back to the message posted in web workers. For example, if:
this.webWorkerCatalogSQLiteDB.postMessage({
id: id,
action: 'exec',
sql: queryStr
});
Results in an error, this gets handled in
this.webWorkerCatalogSQLiteDB.onerror = (error)=> { //TODO };
However, the error object returned doesn't seem to have any reference to the id of the message posted, unlike the success message, which has an event.data.id that references back.
Any advice?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
Start with the web worker postMessage call and the onerror handler shown in the issue, then inspect how success events expose event.data.id. Determine whether the worker error path can retain or expose the posted message id; done would be a documented or implemented way to correlate errors with messages.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- databases, web-dev
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100