From 39ddd8522e2b1d33b0f94f8a4340df22b3e38f49 Mon Sep 17 00:00:00 2001 From: Jonas Geiler Date: Sun, 19 Oct 2025 22:37:00 +0200 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Chengzhong Wu --- doc/api/worker_threads.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index c41ad932464..2741fb66446 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -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.