From 40a20c637631b4a27136617392132738232ca7db Mon Sep 17 00:00:00 2001 From: farisbasha Date: Wed, 18 Nov 2026 14:31:15 +0530 Subject: [PATCH] doc: document heap profile error codes `v8.startHeapProfile()`, `SyncHeapProfileHandle.stop()` and the worker `startHeapProfile()`/`HeapProfileHandle.stop()` APIs throw or reject with `ERR_HEAP_PROFILE_HAVE_BEEN_STARTED` and `ERR_HEAP_PROFILE_NOT_STARTED`, but neither code is listed in `errors.md`. Also drop `v22.20.0` from the `added:` metadata of `worker.startHeapProfile()`: the heap profile API was not backported to v22.x (it is not in `lib/internal/worker.js` up to v22.23.5). Signed-off-by: farisbasha --- doc/api/errors.md | 21 +++++++++++++++++++++ doc/api/worker_threads.md | 4 +--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 881e98f95584..67ac48222415 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1528,6 +1528,27 @@ file in chunks. The number of file system events queued without being handled exceeded the size specified in `maxQueue` in `fs.watch()`. + + +### `ERR_HEAP_PROFILE_HAVE_BEEN_STARTED` + + + +An attempt was made to start a sampling heap profile while one is already +running in the same thread or worker. + + + +### `ERR_HEAP_PROFILE_NOT_STARTED` + + + +An attempt was made to stop a sampling heap profile that is not running. + ### `ERR_HTTP2_ALTSVC_INVALID_ORIGIN` diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index af572039c8ac..ebe7673bafe4 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -1975,9 +1975,7 @@ w.on('online', async () => { ### `worker.startHeapProfile([options])` * `options` {Object}