2015-08-27 08:11:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# crashReporter
 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-14 15:43:35 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 15:39:12 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								>  Submit crash reports to a remote server.
 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:01:57 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-23 11:20:56 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Process: [Main ](../glossary.md#main-process ), [Renderer ](../glossary.md#renderer-process )
							 
						 
					
						
							
								
									
										
										
										
											2016-11-03 10:26:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The following is an example of setting up Electron to automatically submit
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								crash reports to a remote server:
							 
						 
					
						
							
								
									
										
										
										
											2013-08-14 15:43:35 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```javascript
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const { crashReporter } = require('electron')
							 
						 
					
						
							
								
									
										
										
										
											2015-08-28 10:50:30 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								crashReporter.start({ submitURL: 'https://your-domain.com/url-to-submit' })
							 
						 
					
						
							
								
									
										
										
										
											2013-08-14 15:43:35 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-17 22:29:32 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								For setting up a server to accept and process crash reports, you can use
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								following projects:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  [socorro ](https://github.com/mozilla/socorro )
							 
						 
					
						
							
								
									
										
										
										
											2016-05-06 10:09:24 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  [mini-breakpad-server ](https://github.com/electron/mini-breakpad-server )
							 
						 
					
						
							
								
									
										
										
										
											2016-03-17 22:29:32 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-03 14:01:12 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								>  **Note:** Electron uses Crashpad, not Breakpad, to collect and upload
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								>  crashes, but for the time being, the [upload protocol is the same](https://chromium.googlesource.com/crashpad/crashpad/+/HEAD/doc/overview_design.md#Upload-to-collection-server).
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-26 17:37:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Or use a 3rd party hosted solution:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-09 10:30:37 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  [Backtrace ](https://backtrace.io/electron/ )
							 
						 
					
						
							
								
									
										
										
										
											2018-06-19 17:32:37 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  [Sentry ](https://docs.sentry.io/clients/electron )
							 
						 
					
						
							
								
									
										
										
										
											2019-05-06 22:37:24 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  [BugSplat ](https://www.bugsplat.com/docs/platforms/electron )
							 
						 
					
						
							
								
									
										
										
										
											2018-02-26 17:37:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Crash reports are stored temporarily before being uploaded in a directory
							 
						 
					
						
							
								
									
										
										
										
											2021-08-03 14:01:12 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								underneath the app's user data directory, called 'Crashpad'. You can override
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								this directory by calling `app.setPath('crashDumps', '/path/to/crashes')` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								before starting the crash reporter.
							 
						 
					
						
							
								
									
										
										
										
											2020-09-24 08:22:50 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-03 14:01:12 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Electron uses [crashpad ](https://chromium.googlesource.com/crashpad/crashpad/+/refs/heads/main/README.md )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								to monitor and report crashes.
							 
						 
					
						
							
								
									
										
										
										
											2020-09-24 08:22:50 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:01:57 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Methods
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-21 15:42:24 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The `crashReporter`  module has the following methods:
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:01:57 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### `crashReporter.start(options)`
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-13 19:12:13 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-02-16 12:11:05 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `options`  Object
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  *  `submitURL`  string (optional) - URL that crash reports will be sent to as
							 
						 
					
						
							
								
									
										
										
										
											2021-03-18 14:15:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    POST. Required unless `uploadToServer`  is `false` .
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  *  `productName`  string (optional) - Defaults to `app.name` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  *  `companyName`  string (optional) _Deprecated_  - Deprecated alias for
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    `{ globalExtra: { _companyName: ... } }` .
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  *  `uploadToServer`  boolean (optional) - Whether crash reports should be sent
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    to the server. If false, crash reports will be collected and stored in the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    crashes directory, but not uploaded. Default is `true` .
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  *  `ignoreSystemCrashHandler`  boolean (optional) - If true, crashes generated
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    in the main process will not be forwarded to the system crash handler.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    Default is `false` .
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  *  `rateLimit`  boolean (optional) _macOS_  _Windows_  - If true, limit the
							 
						 
					
						
							
								
									
										
										
										
											2020-04-14 10:36:31 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    number of crashes uploaded to 1/hour. Default is `false` .
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  *  `compress`  boolean (optional) - If true, crash reports will be compressed
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 12:43:58 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    and uploaded with `Content-Encoding: gzip` . Default is `true` .
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  *  `extra`  Record< string ,  string >  (optional) - Extra string key/value
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    annotations that will be sent along with crash reports that are generated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    in the main process. Only string values are supported. Crashes generated in
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    child processes will not contain these extra
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    parameters to crash reports generated from child processes, call
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    [`addExtraParameter` ](#crashreporteraddextraparameterkey-value ) from the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    child process.
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  *  `globalExtra`  Record< string ,  string >  (optional) - Extra string key/value
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    annotations that will be sent along with any crash reports generated in any
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    process. These annotations cannot be changed once the crash reporter has
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    been started. If a key is present in both the global extra parameters and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    the process-specific extra parameters, then the global one will take
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    precedence. By default, `productName`  and the app version are included, as
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    well as the Electron version.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This method must be called before using any other `crashReporter`  APIs. Once
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								initialized this way, the crashpad handler collects crashes from all
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								subsequently created processes. The crash reporter cannot be disabled once
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								started.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This method should be called as early as possible in app startup, preferably
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								before `app.on('ready')` . If the crash reporter is not initialized at the time
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								a renderer process is created, then that renderer process will not be monitored
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								by the crash reporter.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								**Note:** You can test out the crash reporter by generating a crash using
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`process.crash()` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								**Note:** If you need to send additional/updated `extra`  parameters after your
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								first call `start`  you can call `addExtraParameter` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								**Note:** Parameters passed in `extra` , `globalExtra`  or set with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`addExtraParameter`  have limits on the length of the keys and values. Key names
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								must be at most 39 bytes long, and values must be no longer than 127 bytes.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Keys with names longer than the maximum will be silently ignored. Key values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								longer than the maximum length will be truncated.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-26 20:07:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								**Note:** This method is only available in the main process.
							 
						 
					
						
							
								
									
										
										
										
											2015-05-30 10:03:59 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:01:57 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `crashReporter.getLastCrashReport()`
 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-11 20:20:36 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Returns [`CrashReport` ](structures/crash-report.md ) - The date and ID of the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								last crash report. Only crash reports that have been uploaded will be returned;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								even if a crash report is present on disk it will not be returned until it is
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								uploaded. In the case that there are no uploaded reports, `null`  is returned.
							 
						 
					
						
							
								
									
										
										
										
											2016-09-25 12:59:30 +13:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-26 20:07:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								**Note:** This method is only available in the main process.
							 
						 
					
						
							
								
									
										
										
										
											2014-11-11 20:20:36 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:01:57 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `crashReporter.getUploadedReports()`
 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-05 19:05:55 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-08 15:54:34 +11:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Returns [`CrashReport[]` ](structures/crash-report.md):
							 
						 
					
						
							
								
									
										
										
										
											2016-09-25 12:59:30 +13:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-26 16:28:44 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Returns all uploaded crash reports. Each report contains the date and uploaded
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ID.
							 
						 
					
						
							
								
									
										
										
										
											2015-06-05 19:05:55 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-26 20:07:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								**Note:** This method is only available in the main process.
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-12 23:42:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `crashReporter.getUploadToServer()`
 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-08 11:12:46 +11:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Returns `boolean`  - Whether reports should be submitted to the server. Set through
							 
						 
					
						
							
								
									
										
										
										
											2016-11-22 19:30:20 +11:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								the `start`  method or `setUploadToServer` .
							 
						 
					
						
							
								
									
										
										
										
											2016-11-08 11:12:46 +11:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-26 20:07:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								**Note:** This method is only available in the main process.
							 
						 
					
						
							
								
									
										
										
										
											2016-11-08 13:39:11 +13:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-12 23:42:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `crashReporter.setUploadToServer(uploadToServer)`
 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-08 11:03:57 +11:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `uploadToServer`  boolean - Whether reports should be submitted to the server.
							 
						 
					
						
							
								
									
										
										
										
											2016-11-08 11:03:57 +11:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-28 15:03:10 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								This would normally be controlled by user preferences. This has no effect if
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								called before `start`  is called.
							 
						 
					
						
							
								
									
										
										
										
											2016-11-08 11:03:57 +11:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-26 20:07:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								**Note:** This method is only available in the main process.
							 
						 
					
						
							
								
									
										
										
										
											2017-02-09 12:47:02 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `crashReporter.addExtraParameter(key, value)`
 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-01 21:21:41 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `key`  string - Parameter key, must be no longer than 39 bytes.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `value`  string - Parameter value, must be no longer than 127 bytes.
							 
						 
					
						
							
								
									
										
										
										
											2017-11-01 21:21:41 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Set an extra parameter to be sent with the crash report. The values specified
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								here will be sent in addition to any values set via the `extra`  option when
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`start`  was called.
							 
						 
					
						
							
								
									
										
										
										
											2017-11-01 21:21:41 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Parameters added in this fashion (or via the `extra`  parameter to
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`crashReporter.start` ) are specific to the calling process. Adding extra
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								parameters in the main process will not cause those parameters to be sent along
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								with crashes from renderer or other child processes. Similarly, adding extra
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								parameters in a renderer process will not result in those parameters being sent
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								with crashes that occur in other renderer processes or in the main process.
							 
						 
					
						
							
								
									
										
										
										
											2017-11-01 21:21:41 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								**Note:** Parameters have limits on the length of the keys and values. Key
							 
						 
					
						
							
								
									
										
										
										
											2020-07-29 19:04:04 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								names must be no longer than 39 bytes, and values must be no longer than 20320
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bytes. Keys with names longer than the maximum will be silently ignored. Key
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								values longer than the maximum length will be truncated.
							 
						 
					
						
							
								
									
										
										
										
											2017-11-01 21:21:41 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `crashReporter.removeExtraParameter(key)`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-14 14:38:54 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `key`  string - Parameter key, must be no longer than 39 bytes.
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-18 15:55:16 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Remove an extra parameter from the current set of parameters. Future crashes
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								will not include this parameter.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### `crashReporter.getParameters()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Returns `Record<string, string>`  - The current 'extra' parameters of the crash reporter.
							 
						 
					
						
							
								
									
										
										
										
											2019-10-14 14:38:54 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-03 14:01:12 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## In Node 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.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#### `process.crashReporter.start(options)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See [`crashReporter.start()` ](#crashreporterstartoptions ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Note that if the crash reporter is started in the main process, it will
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								automatically monitor child processes, so it should not be started in the child
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								process. Only use this method if the main process does not initialize the crash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								reporter.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#### `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 ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-21 15:42:24 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Crash Report Payload
 
							 
						 
					
						
							
								
									
										
										
										
											2014-05-22 14:20:17 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-22 22:53:26 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The crash reporter will send the following data to the `submitURL`  as
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								a `multipart/form-data`  `POST` :
							 
						 
					
						
							
								
									
										
										
										
											2014-05-22 14:20:17 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `ver`  string - The version of Electron.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `platform`  string - e.g. 'win32'.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `process_type`  string - e.g. 'renderer'.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `guid`  string - e.g. '5e1286fc-da97-479e-918b-6bfb0c3d1c72'.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `_version`  string - The version in `package.json` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `_productName`  string - The product name in the `crashReporter`  `options` 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:18:02 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  object.
							 
						 
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `prod`  string - Name of the underlying product. In this case Electron.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `_companyName`  string - The company name in the `crashReporter`  `options` 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:18:02 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  object.
							 
						 
					
						
							
								
									
										
										
										
											2016-03-17 22:29:32 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `upload_file_minidump`  File - The crash report in the format of `minidump` .
							 
						 
					
						
							
								
									
										
										
										
											2016-10-10 14:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  All level one properties of the `extra`  object in the `crashReporter` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  `options`  object.