Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rkaw92
Created June 3, 2014 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rkaw92/a10d705b9d4bcebd550b to your computer and use it in GitHub Desktop.
Save rkaw92/a10d705b9d4bcebd550b to your computer and use it in GitHub Desktop.
How to break when.js rejection handler detection
var when1 = require('when1');
var when2 = require('when2');
var rejectedPromise = when1.reject(new Error('Intentional failure'));
when2(rejectedPromise).done(undefined, function(error){
console.log('Rejection properly handled:', error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment