I found this section in Ember Guides explaining the debugging configuration.
The questions I have are:
- What is the right place to put the suggested code-snippet inside of
app.js
:
RSVP.on('error', function(error) {
assert(error, false);
});
if the app.js
already have has the following lines:
# app.js
import Application from '@ember/application';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
});
loadInitializers(App, config.modulePrefix);
export default App;
- How is it related and is it still valid to use an initializer and put the following errors handlers in it:
# initializers/catch-all-errors.js
// Global error handler in Ember run loop
Ember.onerror = function (err) {
console.log(err);
};
// Global error handler for promises
Ember.RSVP.on('error', function(err) {
console.log(err);
});
based on this blog article ?
Thank you!