Commit b647a816 authored by Nicolai Kamenzky's avatar Nicolai Kamenzky
Browse files

Merge pull request #98 from RebootJeff/patch-1

Clarify docs to avoid anti-pattern for .catch
parents 21db39f7 99b96227
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -231,16 +231,18 @@ rp('http://google.com')
    .then(null, handleError);


// By the way, this:
// However, this:
rp('http://google.com')
    .then(process)
    .catch(handleError);

// ... is equivalent to:
// ... is safer than:
rp('http://google.com')
    .then(process, handleError);
```

For more info on `.then(process).catch(handleError)` versus `.then(process, handleError)`, see Bluebird docs on [promise anti-patterns](http://bluebirdjs.com/docs/anti-patterns.html#the-.then).

### .finally(onFinished)

``` js