feat: add error event for utility process (#43774)

* feat: add error event for utility process

* chore: use public report api

* chore: fix lint

* doc: mark error event as experimental

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Robo 2024-09-27 10:17:06 +09:00 committed by GitHub
parent 8397fef3ef
commit f68184a9f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 167 additions and 5 deletions

View file

@ -116,6 +116,17 @@ When the child process exits, then the value is `null` after the `exit` event is
Emitted once the child process has spawned successfully.
#### Event: 'error' _Experimental_
Returns:
* `type` string - Type of error. One of the following values:
* `FatalError`
* `location` string - Source location from where the error originated.
* `report` string - [`Node.js diagnostic report`][].
Emitted when the child process needs to terminate due to non continuable error from V8.
#### Event: 'exit'
Returns:
@ -138,3 +149,4 @@ Emitted when the child process sends a message using [`process.parentPort.postMe
[stdio]: https://nodejs.org/dist/latest/docs/api/child_process.html#optionsstdio
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[`MessagePortMain`]: message-port-main.md
[`Node.js diagnostic report`]: https://nodejs.org/docs/latest/api/report.html#diagnostic-report