# promise-done [![npm version](http://img.shields.io/npm/v/promise-done.svg?style=flat-square)](https://www.npmjs.org/package/promise-done)

> Propagate errors out of promise context.

Description
-----------

This library allows to terminate promises by throwing an exception for
unhandled errors. This is especially useful when we just want the stack
trace to be displayed in case of unhandled error.

Usage
-----

```js
import done from 'promise-done'

stuff()
  .then(otherStuff())
  .then(null, done)
```

# promise-done [![npm version](http://img.shields.io/npm/v/promise-done.svg?style=flat-square)](https://www.npmjs.org/package/promise-done)

> Propagate errors out of promise context.

Description
-----------

This library allows to terminate promises by throwing an exception for
unhandled errors. This is especially useful when we just want the stack
trace to be displayed in case of unhandled error.

Usage
-----

```js
import done from 'promise-done'

stuff()
  .then(otherStuff())
  .catch(done)
```

Use .catch(...) rather than .then(null, ...)
Use .catch(...) rather than .then(null, ...)

It's more readable, and equivalent. See also [this](https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns#the-thensuccess-fail-anti-pattern).