Skip to content

Instantly share code, notes, and snippets.



Forked from gkatsev/gist:6143193
Last active Dec 20, 2015
What would you like to do?
function foo(id) {
return bar(id).then(function (obj) {
if (!obj) {
throw new Error('no obj');
return obj; // pass it through
function (obj) {
console.log('we got here, and have an obj; passing it through');
return obj;
function (err) {
console.log('we got an error; re-throwing it');
throw err;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment