Improve the grammar, sentence structure, punctuation and formatting of `crash-reporter.md`.
2.3 KiB
crash-reporter
The following is an example of automatically submitting a crash report to a remote server:
crashReporter = require('crash-reporter');
crashReporter.start({
productName: 'YourName',
companyName: 'YourCompany',
submitUrl: 'https://your-domain.com/url-to-submit',
autoSubmit: true
});
crashReporter.start(options)
options
ObjectproductName
String, default: ElectroncompanyName
String, default: GitHub, IncsubmitUrl
String, default: http://54.249.141.255:1127/post- URL that crash reports will be sent to as POST
autoSubmit
Boolean, default: true- Send the crash report without user interaction
ignoreSystemCrashHandler
Boolean, default: falseextra
Object- An object you can define that will be sent along with the report.
- Only string properties are sent correctly.
- Nested objects are not supported.
Developers are required to call this method before using other crashReporter
APIs.
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.
crashReporter.getLastCrashReport()
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.
crashReporter.getUploadedReports()
Returns all uploaded crash reports. Each report contains the date and uploaded ID.
crash-reporter payload
The crash reporter will send the following data to the submitUrl
as POST
:
rept
String - e.g. 'electron-crash-service'ver
String - The version of Electronplatform
String - e.g. 'win32'process_type
String - e.g. 'renderer'ptime
Number_version
String - The version inpackage.json
_productName
String - The product name in thecrashReporter
options
objectprod
String - Name of the underlying product. In this case Electron_companyName
String - The company name in thecrashReporter
options
objectupload_file_minidump
File - The crashreport as file- All level one properties of the
extra
object in thecrashReporter
options
object