# firescript-error

> Generic error class for Firescript

Latest version **1.2.0** (published 2022-03-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install firescript-error
pnpm add firescript-error
yarn add firescript-error
bun add firescript-error
```

## 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 | 1.2.0 |
| Published | 2022-03-30 |
| First published | 2020-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andi Heinkelein |
| Maintainers | firetux |
| Keywords | firescript, firelib, firescript-module, fire, error, errorhandler, fserror |

## Links

- npm: https://www.npmjs.com/package/firescript-error
- npm.io page: https://npm.io/package/firescript-error

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

- 1.2.0 (latest) — 2022-03-30
- 1.1.4 — 2021-05-28
- 1.1.3 — 2021-03-22
- 1.1.2 — 2021-03-01
- 1.1.1 — 2021-03-01
- 1.1.0 — 2021-01-15
- 1.0.1 — 2020-11-21
- 1.0.0 — 2020-11-21

## README

Firescript Error
===============

Error base class for Firescript

```coffee
import FirescriptError from 'firescript-error'

export class MyError extends FirescriptError
    constructor (...args)
        super(...args)
        this.name = 'MyError'
        this.code = 'MY_ERR_CODE'
```

### .from(*obj* err)

Create FirescriptError styled error from an error object

```coffee
try
    # some error happens
catch err
    throw FirescriptError.from(err)
```


### Colors

Error messages are pretty colorized in the CLI.
The FirescriptError module detects whether the `stdout` is a tty terminal or not and set the colormode based on this information.
You can control the colormode by setting an env variable called `FIRESCRIPT_ERROR_COLORS`

```shell
export FIRESCRIPT_ERROR_COLORS=1 # enable error colors
export FIRESCRIPT_ERROR_COLORS=0 # disable error colors
```

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