Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.