2013-09-09 07:35:57 +00:00
|
|
|
# crash-reporter
|
2013-08-14 22:43:35 +00:00
|
|
|
|
2015-07-23 17:02:45 +00:00
|
|
|
The following is an example of automatically submitting a crash report to a remote server:
|
2013-08-14 22:43:35 +00:00
|
|
|
|
|
|
|
```javascript
|
|
|
|
crashReporter = require('crash-reporter');
|
2013-11-14 05:39:44 +00:00
|
|
|
crashReporter.start({
|
|
|
|
productName: 'YourName',
|
|
|
|
companyName: 'YourCompany',
|
|
|
|
submitUrl: 'https://your-domain.com/url-to-submit',
|
|
|
|
autoSubmit: true
|
|
|
|
});
|
2013-08-14 22:43:35 +00:00
|
|
|
```
|
|
|
|
|
2013-11-14 05:39:44 +00:00
|
|
|
## crashReporter.start(options)
|
2013-11-13 11:12:13 +00:00
|
|
|
|
2013-11-14 05:39:44 +00:00
|
|
|
* `options` Object
|
2015-04-16 03:31:12 +00:00
|
|
|
* `productName` String, default: Electron
|
2014-05-22 12:20:17 +00:00
|
|
|
* `companyName` String, default: GitHub, Inc
|
|
|
|
* `submitUrl` String, default: http://54.249.141.255:1127/post
|
2015-07-23 17:02:45 +00:00
|
|
|
* URL that crash reports will be sent to as POST
|
2014-05-22 12:20:17 +00:00
|
|
|
* `autoSubmit` Boolean, default: true
|
|
|
|
* Send the crash report without user interaction
|
|
|
|
* `ignoreSystemCrashHandler` Boolean, default: false
|
|
|
|
* `extra` Object
|
2015-07-23 17:02:45 +00:00
|
|
|
* An object you can define that will be sent along with the report.
|
2015-07-03 18:34:36 +00:00
|
|
|
* Only string properties are sent correctly.
|
2014-05-22 12:20:17 +00:00
|
|
|
* Nested objects are not supported.
|
|
|
|
|
2015-07-23 17:02:45 +00:00
|
|
|
Developers are required to call this method before using other `crashReporter` APIs.
|
2015-06-05 11:05:55 +00:00
|
|
|
|
2015-07-23 17:02:45 +00:00
|
|
|
**Note:** On OS X, Electron uses a new `crashpad` client, which is different
|
|
|
|
from `breakpad` on Windows and Linux. To enable the crash collection feature,
|
|
|
|
you are required to call `crashReporter.start` API to initialize `crashpad` in the
|
|
|
|
main process and in each renderer process from which you wish to collect crash reports.
|
2015-05-30 02:03:59 +00:00
|
|
|
|
2014-11-11 12:20:36 +00:00
|
|
|
## crashReporter.getLastCrashReport()
|
|
|
|
|
2015-07-23 17:02:45 +00:00
|
|
|
Returns the date and ID of the last crash report. If no crash reports have been
|
|
|
|
sent or the crash reporter has not been started, `null` is returned.
|
2014-11-11 12:20:36 +00:00
|
|
|
|
2015-06-05 11:05:55 +00:00
|
|
|
## crashReporter.getUploadedReports()
|
|
|
|
|
2015-07-23 17:02:45 +00:00
|
|
|
Returns all uploaded crash reports. Each report contains the date and uploaded ID.
|
2015-06-05 11:05:55 +00:00
|
|
|
|
2014-05-22 12:20:17 +00:00
|
|
|
# crash-reporter payload
|
|
|
|
|
|
|
|
The crash reporter will send the following data to the `submitUrl` as `POST`:
|
|
|
|
|
2015-04-16 03:31:12 +00:00
|
|
|
* `rept` String - e.g. 'electron-crash-service'
|
|
|
|
* `ver` String - The version of Electron
|
2015-03-26 15:20:31 +00:00
|
|
|
* `platform` String - e.g. 'win32'
|
|
|
|
* `process_type` String - e.g. 'renderer'
|
2014-05-22 12:20:17 +00:00
|
|
|
* `ptime` Number
|
|
|
|
* `_version` String - The version in `package.json`
|
2015-07-23 17:02:45 +00:00
|
|
|
* `_productName` String - The product name in the `crashReporter` `options` object
|
2015-04-16 03:31:12 +00:00
|
|
|
* `prod` String - Name of the underlying product. In this case Electron
|
2015-07-23 17:02:45 +00:00
|
|
|
* `_companyName` String - The company name in the `crashReporter` `options` object
|
2014-05-22 12:20:17 +00:00
|
|
|
* `upload_file_minidump` File - The crashreport as file
|
2015-07-23 17:02:45 +00:00
|
|
|
* All level one properties of the `extra` object in the `crashReporter` `options` object
|