mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-23 04:03:00 -05:00
[next] Better Errors - Worker (#1602)
This commit is contained in:
committed by
GitHub
parent
0c54036466
commit
413428f535
@@ -53,5 +53,12 @@ export default (...args) =>
|
||||
|
||||
if (isHook) this.onWorkerReady?.(this.interpreter, worker);
|
||||
|
||||
worker.addEventListener("message", (event) => {
|
||||
if (event.data instanceof Error) {
|
||||
event.stopImmediatePropagation();
|
||||
worker.onerror(event);
|
||||
}
|
||||
});
|
||||
|
||||
return worker;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user