From a0c77549bd2dc1c327046a23af83645344201c16 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Sat, 18 Apr 2015 03:01:27 +0800 Subject: [PATCH] Bluebird: fix Promise.try --- bluebird.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bluebird.md b/bluebird.md index 568805a08..923a9d664 100644 --- a/bluebird.md +++ b/bluebird.md @@ -40,10 +40,14 @@ Promise.props({ ### Chain of promises ```js -Promise.try(function () { - if (err) throw new Error("boo"); - return result; -}); +function getPhotos() { + return Promise.try(function () { + if (err) throw new Error("boo"); + return result; + }); +} + +getPhotos().then(...) ``` ### Working with node-style functions