Created
October 22, 2015 20:20
-
-
Save nevyn/c9b7de08d68670dad750 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!env NODE_PATH=/usr/local/lib/node_modules node --harmony | |
var Promise = require("bluebird") | |
var b = Promise.method(function() { | |
throw new Error("omg"); | |
return "b"; | |
}) | |
var a = Promise.coroutine(function *() { | |
var ret = yield b(); | |
return ret; | |
}); | |
a().then(function(v) { | |
console.log("Value", v); | |
}).catch(function(e) { | |
console.log("Error", e); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment