Skip to content

Instantly share code, notes, and snippets.

@benjamingr
Created September 29, 2015 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjamingr/f7a1d00248718dcc36a1 to your computer and use it in GitHub Desktop.
Save benjamingr/f7a1d00248718dcc36a1 to your computer and use it in GitHub Desktop.

You mean something like:

process.on("unhandledRejection", function(p, reason){
  console.log('Uncaught error: ', reason); // this will get called
});

Promise.resolve().then(x => { throw "Hah"; }); 

And similarly in browsers?

In RSVP by the way, you'd do:

RSVP.on('error', function(reason) {
  console.log("Uncaught Error", reason);
});

RSVPPromise.resolve().then(x => { throw "Hah"; });

Since you mentioned RSVP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment