|
|
|
|
|
by sciolistse
4574 days ago
|
|
In generator code you'd use try/catch to handle failure instead. try {
var user = yield Users.get(1234);
return user.name;
} catch(ex) {
// do whatever
}
rather than.. return Users.get(1234).then(
function (u) { return u.name; },
function (ex) { /* do whatever */ }
);
|
|