Bluebird: fix Promise.try

This commit is contained in:
Rico Sta. Cruz 2015-04-18 03:01:27 +08:00
parent e1fb322670
commit a0c77549bd
1 changed files with 8 additions and 4 deletions

View File

@ -40,10 +40,14 @@ Promise.props({
### Chain of promises ### Chain of promises
```js ```js
Promise.try(function () { function getPhotos() {
return Promise.try(function () {
if (err) throw new Error("boo"); if (err) throw new Error("boo");
return result; return result;
}); });
}
getPhotos().then(...)
``` ```
### Working with node-style functions ### Working with node-style functions