Make companyName and submitURL required options
This commit is contained in:
parent
dcc99dd5cb
commit
524649797f
2 changed files with 13 additions and 4 deletions
|
@ -19,8 +19,6 @@ class CrashReporter
|
||||||
{app} = if process.type is 'browser' then electron else electron.remote
|
{app} = if process.type is 'browser' then electron else electron.remote
|
||||||
|
|
||||||
@productName ?= app.getName()
|
@productName ?= app.getName()
|
||||||
companyName ?= 'GitHub, Inc'
|
|
||||||
submitURL ?= 'http://54.249.141.255:1127/post'
|
|
||||||
autoSubmit ?= true
|
autoSubmit ?= true
|
||||||
ignoreSystemCrashHandler ?= false
|
ignoreSystemCrashHandler ?= false
|
||||||
extra ?= {}
|
extra ?= {}
|
||||||
|
@ -29,6 +27,14 @@ class CrashReporter
|
||||||
extra._companyName ?= companyName
|
extra._companyName ?= companyName
|
||||||
extra._version ?= app.getVersion()
|
extra._version ?= app.getVersion()
|
||||||
|
|
||||||
|
unless companyName?
|
||||||
|
deprecate.log('companyName is now a required option to CrashReporter::start')
|
||||||
|
return
|
||||||
|
|
||||||
|
unless submitURL?
|
||||||
|
deprecate.log('submitURL is now a required option to CrashReporter::start')
|
||||||
|
return
|
||||||
|
|
||||||
start = => binding.start @productName, companyName, submitURL, autoSubmit, ignoreSystemCrashHandler, extra
|
start = => binding.start @productName, companyName, submitURL, autoSubmit, ignoreSystemCrashHandler, extra
|
||||||
|
|
||||||
if process.platform is 'win32'
|
if process.platform is 'win32'
|
||||||
|
@ -59,6 +65,5 @@ class CrashReporter
|
||||||
path.join tmpdir, "#{@productName} Crashes", 'uploads.log'
|
path.join tmpdir, "#{@productName} Crashes", 'uploads.log'
|
||||||
binding._getUploadedReports log
|
binding._getUploadedReports log
|
||||||
|
|
||||||
|
|
||||||
crashRepoter = new CrashReporter
|
crashRepoter = new CrashReporter
|
||||||
module.exports = crashRepoter
|
module.exports = crashRepoter
|
||||||
|
|
|
@ -54,7 +54,10 @@ deprecate.event = (emitter, oldName, newName, fn) ->
|
||||||
|
|
||||||
# Print deprecate warning.
|
# Print deprecate warning.
|
||||||
deprecate.warn = (oldName, newName) ->
|
deprecate.warn = (oldName, newName) ->
|
||||||
message = "#{oldName} is deprecated. Use #{newName} instead."
|
deprecate.log("#{oldName} is deprecated. Use #{newName} instead.")
|
||||||
|
|
||||||
|
# Print deprecation message
|
||||||
|
deprecate.log = (message) ->
|
||||||
if process.throwDeprecation
|
if process.throwDeprecation
|
||||||
throw new Error(message)
|
throw new Error(message)
|
||||||
else if process.traceDeprecation
|
else if process.traceDeprecation
|
||||||
|
@ -62,4 +65,5 @@ deprecate.warn = (oldName, newName) ->
|
||||||
else
|
else
|
||||||
console.warn "(electron) #{message}"
|
console.warn "(electron) #{message}"
|
||||||
|
|
||||||
|
|
||||||
module.exports = deprecate
|
module.exports = deprecate
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue