Add new event method for unhandled errors.

This commit is contained in:
Ben Ogle
2014-11-03 16:18:20 -08:00
parent 5dd310f9ac
commit 78dc87d4b6

View File

@@ -177,6 +177,7 @@ class Atom extends Model
@executeJavaScriptInDevTools('InspectorFrontendAPI.showConsole()')
@lastUncaughtError = Array::slice.call(arguments)
@emit 'uncaught-error', arguments...
@emitter.emit 'did-throw-error', arguments...
@unsubscribe()
@setBodyPlatformClass()
@@ -247,6 +248,15 @@ class Atom extends Model
onDidBeep: (callback) ->
@emitter.on 'did-beep', callback
# Extended: Invoke the given callback whenever there is an unhandled error.
#
# * `callback` {Function} to be called whenever there is an unhandled error
# * `errorMessage` {String}
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidThrowError: (callback) ->
@emitter.on 'did-throw-error', callback
###
Section: Atom Details
###