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/4e8ec9fe13aacaf5a30b to your computer and use it in GitHub Desktop.
Save petehunt/4e8ec9fe13aacaf5a30b to your computer and use it in GitHub Desktop.
var co = require('co');
var thunkify = require('thunkify');
var request = require('request');
var get = thunkify(request.get);
function *helper() {
yield get('http://google.com/');
throw new Error('something unexpected happened');
}
co(function *(){
yield helper();
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment