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 2025-10-19 22:37:00 +02:00 committed by GitHub
parent f25cce2805
commit 9fbf0cbc60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1717,7 +1717,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.