Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@petehunt
Created August 24, 2014 18:36
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 petehunt/f590b37541e43c760c94 to your computer and use it in GitHub Desktop.
Save petehunt/f590b37541e43c760c94 to your computer and use it in GitHub Desktop.
var bluebird = require('bluebird');
var request = require('request');
bluebird.promisifyAll(request);
bluebird.longStackTraces();
var helper = bluebird.coroutine(function*() {
yield request.getAsync('http://google.com/');
throw new Error('something unexpected happened');
});
bluebird.coroutine(function*() {
yield helper();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment