# avocat

> A simple library to convert objection errors to boom errors

Latest version **2.0.0** (published 2020-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install avocat
pnpm add avocat
yarn add avocat
bun add avocat
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2020-02-21 |
| First published | 2018-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/avocat) |
| Module format | CommonJS |
| Node | >=12.x.x |
| Dependencies | 1 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Daniel COLE |
| Maintainers | optii |
| Keywords | objection, errors, database, hapi, boom |

## Links

- npm: https://www.npmjs.com/package/avocat
- Repository: https://github.com/hapipal/avocat
- Homepage: https://github.com/hapipal/avocat#readme
- Issues: https://github.com/hapipal/avocat/issues
- npm.io page: https://npm.io/package/avocat

## Dependencies (1)

- [@hapi/boom](https://npm.io/package/@hapi/boom.md) 9.x.x

## 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

- 2.0.0 (latest) — 2020-02-21
- 1.1.0 — 2019-12-06
- 1.0.2 — 2019-06-28
- 1.0.1 — 2018-04-18
- 1.0.0 — 2018-04-18
- 0.0.1 — 2018-03-30

## README

# avocat

A library to convert Objection errors to Boom errors

[![Build Status](https://travis-ci.org/hapipal/avocat.svg?branch=master)](https://travis-ci.org/hapipal/avocat) [![Coverage Status](https://coveralls.io/repos/github/hapipal/avocat/badge.svg?branch=master)](https://coveralls.io/github/hapipal/avocat?branch=master) 

Lead Maintainer: [Daniel Cole](https://github.com/optii)


## Usage

### `rethrow(error, [options])`

 Throws a `Boom` error according to the `Objection` error received

 - `error`: - the `Objection` error (any other types of errors are just ignored)
 - `options`: - optional object where:
     - `return`: - if `true` will return the error instead of throwing it
     - `includeMessage`: if `true` the Boom error created will have it's message set to the message of the error thrown


Heavily inspired by [Bounce](https://github.com/hapijs/bounce)

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