docs: document process.crashReporter apis in node children (#25579)

This commit is contained in:
Jeremy Rose 2020-09-24 08:22:50 -07:00 committed by GitHub
parent 1f856c25a9
commit 3ceaf4aa54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,37 @@ is an implementation detail driven by Chromium, and it may change in future. In
particular, crashpad is newer and will likely eventually replace breakpad on particular, crashpad is newer and will likely eventually replace breakpad on
all platforms. all platforms.
### Note about Node child processes on Linux
If you are using the Node.js `child_process` module and want to report crashes
from those processes on Linux, there is an extra step you will need to take to
properly initialize the crash reporter in the child process. This is not
necessary on Mac or Windows, as those platforms use Crashpad, which
automatically monitors child processes.
Since `require('electron')` is not available in Node child processes, the
following APIs are available on the `process` object in Node child processes.
Note that, on Linux, each Node child process has its own separate instance of
the breakpad crash reporter. This is dissimilar to renderer child processes,
which have a "stub" breakpad reporter which returns information to the main
process for reporting.
#### `process.crashReporter.start(options)`
See [`crashReporter.start()`](#crashreporterstartoptions).
#### `process.crashReporter.getParameters()`
See [`crashReporter.getParameters()`](#crashreportergetparameters).
#### `process.crashReporter.addExtraParameter(key, value)`
See [`crashReporter.addExtraParameter(key, value)`](#crashreporteraddextraparameterkey-value).
#### `process.crashReporter.removeExtraParameter(key)`
See [`crashReporter.removeExtraParameter(key)`](#crashreporterremoveextraparameterkey).
## Methods ## Methods
The `crashReporter` module has the following methods: The `crashReporter` module has the following methods: