electron/docs/api/crash-reporter.md

55 lines
2.1 KiB
Markdown
Raw Normal View History

2013-09-09 07:35:57 +00:00
# crash-reporter
2013-08-14 22:43:35 +00:00
An example of automatically submitting crash reporters to remote server:
```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-14 05:39:44 +00:00
* `options` Object
2015-04-16 03:31:12 +00:00
* `productName` String, default: Electron
* `companyName` String, default: GitHub, Inc
* `submitUrl` String, default: http://54.249.141.255:1127/post
* URL that crash reports would be sent to as POST
* `autoSubmit` Boolean, default: true
* Send the crash report without user interaction
* `ignoreSystemCrashHandler` Boolean, default: false
* `extra` Object
* An object you can define which content will be send along with the report.
* Only string properties are send correctly.
* Nested objects are not supported.
2015-05-30 02:03:59 +00:00
**Note:** On OS X, electron uses a new `crashpad` client, which is different
with the `breakpad` on Windows and Linux. To enable crash collection feature,
2015-06-04 07:52:16 +00:00
you are required to call `crashReporter.start` API to initiliaze `crashpad` in
main process, even you only collect crash report in renderer process.
2015-05-30 02:03:59 +00:00
2014-11-11 12:20:36 +00:00
## crashReporter.getLastCrashReport()
Returns the date and ID of last crash report, when there was no crash report
sent or the crash reporter is not started, `null` will be returned.
# 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
* `platform` String - e.g. 'win32'
* `process_type` String - e.g. 'renderer'
* `ptime` Number
* `_version` String - The version in `package.json`
* `_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
* `_companyName` String - The company name in the crashReporter `options` object
* `upload_file_minidump` File - The crashreport as file
* All level one properties of the `extra` object in the crashReporter `options` object