Update: 25/07/2013 : The solution described below does not work with RC6 .. You will need to get ember-latest.
Are you finding that errors occurring in your promise handlers are being swallowed silently by Ember.js ? I had written some code that looked like this:
The problem was that I was calling this.getXXX while in the scope of the then() function, which is globally scoped. This was easily fixed by passing a reference to controller scope, but normally these kind of mistakes are logged to the console.
Turns out the then() callback function was being executed by Ember.js in a try/catch block, with the error being passed to the default reject handler which was swallowing the error.
Luckily @teddyzeenny was in the IRC channel to offer some advice. Heres a code snippet that you can add to your Ember.js application to make sure these errors get logged to the console.
Pingback: Don't let Ember.js swallow errors in your promi...
This seems to be not available in Ember RC6. Do you know of any workaround in RC6? Thanks!
Hey Marcus,
I’m not actually sure. I’m using v1.0.0-rc.6-167
I downloaded it from the EmberJS Homepage. The header of the JS File says:
// Version: v1.0.0-rc.6
// Last commit: 893bbc4 (2013-06-23 15:14:46 -0400)
I have actually searched for the lines of the commit that enabled the ‘onerror’ handler. It is not present in my file :-/. So i guess i will have to wait for it.
Try this: http://builds.emberjs.com.s3.amazonaws.com/ember-latest.js
Works with this version 🙂 Do you have any idea when this will hit a release build? It is probably not a good idea to use the latest build in production 🙂
Thanks though for your help
I don’t know about the timings for RC7… But thanks for letting me know about this.. I’ll update the post
FYI: Ember now ships with a very similar default.