doc: use any for worker_threads.Worker 'error' event argument err

A worker thread can throw anything via the `throw` keyword, which gets
passed directly to 'error' event listeners. The event listener should
not assume it is an `Error` object.

PR-URL: https://github.com/nodejs/node/pull/60300
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
Jonas Geiler authored and Antoine du Hamel committed 2025-11-07 18:11:34 +01:00
1 parent c67cb727cb
commit 39ddd8522e
1 file changed
+1 -1
+1 -1
View File
@@ -1713,7 +1713,7 @@ changes:
added: v10.5.0
-->
* `err` {Error}
* `err` {any}
The `'error'` event is emitted if the worker thread throws an uncaught
exception. In that case, the worker is terminated.