Commit 99b96227 authored by Jeff Lee's avatar Jeff Lee
Browse files

Clarify docs to avoid anti-pattern for .catch

parent 21db39f7
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