Use ".then(null, Cu.reportError);" with Promise.jsm

Matt Brubeck mbrubeck at mozilla.com
Fri Aug 9 21:25:53 UTC 2013


On 8/9/2013 2:26 AM, Mike Ratcliffe wrote:
> You should also be able to use:
>    Task.spawn(function () {
>      // yield ...
>    }).then(null, console.error);
Should we make this a default behavior in Task.jsm (when it's used in a 
scope where console.error or Cu.reportError are available)? It seems 
that removing the need for boilerplate (and footgun potential when the 
boilerplate is forgotten) would be worth the cost of maybe increasing 
chatter on the error console.



More information about the firefox-dev mailing list