feat: allow omitting submitURL when uploadToServer is false (#28105)

This commit is contained in:
Jeremy Rose 2021-03-18 14:15:19 -07:00 committed by GitHub
parent f35fc93080
commit 502d4c19ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View file

@ -10,13 +10,13 @@ class CrashReporter {
extra = {},
globalExtra = {},
ignoreSystemCrashHandler = false,
submitURL,
submitURL = '',
uploadToServer = true,
rateLimit = false,
compress = true
} = options || {};
if (submitURL == null) throw new Error('submitURL is a required option to crashReporter.start');
if (uploadToServer && !submitURL) throw new Error('submitURL must be specified when uploadToServer is true');
if (!compress && uploadToServer) {
deprecate.log('Sending uncompressed crash reports is deprecated and will be removed in a future version of Electron. Set { compress: true } to opt-in to the new behavior. Crash reports will be uploaded gzipped, which most crash reporting servers support.');