# combine-errors

> Combine errors into one

Latest version **3.0.3** (published 2016-06-28) · 0 weekly downloads

## Install

```sh
npm install combine-errors
pnpm add combine-errors
yarn add combine-errors
bun add combine-errors
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2016-06-28 |
| First published | 2016-03-11 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Matthew Mueller |
| Maintainers | mattmueller |
| Keywords | combine, errors, compose, error, handling |

## Links

- npm: https://www.npmjs.com/package/combine-errors
- Repository: https://github.com/MatthewMueller/combine-errors
- Homepage: https://github.com/MatthewMueller/combine-errors#readme
- Issues: https://github.com/MatthewMueller/combine-errors/issues
- npm.io page: https://npm.io/package/combine-errors

## Dependencies (2)

- [lodash.uniqby](https://npm.io/package/lodash.uniqby.md) 4.5.0
- [custom-error-instance](https://npm.io/package/custom-error-instance.md) 2.1.1

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 3.0.3 (latest) — 2016-06-28
- 3.0.2 — 2016-06-07
- 3.0.1 — 2016-04-24
- 3.0.0 — 2016-03-25
- 2.0.0 — 2016-03-23
- 1.0.1 — 2016-03-11
- 1.0.0 — 2016-03-11

## README

# combine-errors

  Simple way to combine multiple errors into one.

  This is useful for handling multiple asynchronous errors, where you want to catch all the errors and combine them to return just a single error.

## Features

- `error instanceof Error === true`
- composable: `error([error([err1, err2]), err3])`
- stack and message are combined in a nice way
- array-like object, so you can access the original errors by looping over the error
- If you just have one error, it looks exactly like raw error meaning, `error(err).message === err.message && error(err).stack === err.stack`
- should work in the browser, though I haven't tested it yet

## Installation

```
npm install combine-errors
```

## Usage

```js
var error = require('combine-errors')
var err = error([
  new Error('boom'),
  new Error('kablam')
])
throw err
/*
=>
Error: boom
    at repl:2:1
    at REPLServer.defaultEval (repl.js:262:27)
    at bound (domain.js:287:14)
    at REPLServer.runBound [as eval] (domain.js:300:12)
    at REPLServer.<anonymous> (repl.js:431:12)
    at emitOne (events.js:95:20)
    at REPLServer.emit (events.js:182:7)
    at REPLServer.Interface._onLine (readline.js:211:10)
    at REPLServer.Interface._line (readline.js:550:8)
    at REPLServer.Interface._ttyWrite (readline.js:827:14)

Error: kablam
    at repl:3:1
    at REPLServer.defaultEval (repl.js:262:27)
    at bound (domain.js:287:14)
    at REPLServer.runBound [as eval] (domain.js:300:12)
    at REPLServer.<anonymous> (repl.js:431:12)
    at emitOne (events.js:95:20)
    at REPLServer.emit (events.js:182:7)
    at REPLServer.Interface._onLine (readline.js:211:10)
    at REPLServer.Interface._line (readline.js:550:8)
    at REPLServer.Interface._ttyWrite (readline.js:827:14)
*/
```

## License

MIT

---
_Source: https://npm.io/package/combine-errors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
