W3cubDocs

/Ember.js

Ember (public)

Defined in: packages/ember-metal/lib/core.js:8
Module: ember

onerror (error) public

error
Exception
the error object

A function may be assigned to Ember.onerror to be called when Ember internals encounter an error. This is useful for specialized error handling and reporting code.

Ember.onerror = function(error) {
  Em.$.ajax('/report-error', 'POST', {
    stack: error.stack,
    otherInformation: 'whatever app state you want to provide'
  });
};

Internally, Ember.onerror is used as Backburner's error handler.

© 2017 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://emberjs.com/api/ember/2.14/classes/Ember/events