Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4827

Errors handling

$
0
0

@belgoros wrote:

I found this section in Ember Guides explaining the debugging configuration.

The questions I have are:

  1. 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;
  1. 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!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4827

Trending Articles