attilagyorffy.com

Squeezing out the truth of RSVP Errors

Introduction

Attila Györffy

Attila Györffy

I'm a Ruby/JS dev/trainer with a focus on quality. An ex-Londoner, @terracycle, @ubxd, @lastfm. Follow me at http://twitter.com/attilagyorffy


Squeezing out the truth of RSVP Errors

Posted by Attila Györffy on .
Featured

Squeezing out the truth of RSVP Errors

Posted by Attila Györffy on .

There are times when dealing with promises that it seems like any errors are being 'swallowed', and not properly raised. This makes is extremely difficult to track down where a given issue is coming from. Thankfully, RSVP has a solution for this problem built in.

You can register functions to be called when an uncaught error occurs within your promises. These callback functions can be anything, but a common practice is to call console.assert to dump the error to the console.

The file below registers an initializer in an Ember-CLI application to log the issues to the console:

Attila Györffy

Attila Györffy

https://attilagyorffy.com

I'm a Ruby/JS dev/trainer with a focus on quality. An ex-Londoner, @terracycle, @ubxd, @lastfm. Follow me at http://twitter.com/attilagyorffy

View Comments...