# firerr

> Catch Firebase Error From Asynchronous Functions

Latest version **0.2.0** (published 2022-03-09) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2022-03-09 |
| First published | 2022-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.0.0 |
| Dependencies | 1 |
| Unpacked size | 40.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | qwyzex |
| Maintainers | qwyzex |
| Keywords | firebase, error, handling |

## Links

- npm: https://www.npmjs.com/package/firerr
- Repository: https://github.com/qwyzex/firerr
- Issues: https://github.com/qwyzex/firerr/issues/new
- npm.io page: https://npm.io/package/firerr

## Dependencies (1)

- [firebase](https://npm.io/package/firebase.md) ^9.6.8

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

- 0.2.0 (latest) — 2022-03-09
- 0.1.4 — 2022-02-13
- 0.1.3 — 2022-02-05
- 0.1.2 — 2022-02-02
- 0.1.1 — 2022-02-01
- 0.1.0 — 2022-01-31
- 0.0.5 — 2022-01-31
- 0.0.4 — 2022-01-30
- 0.0.3 — 2022-01-30
- 0.0.2 — 2022-01-29
- 0.0.1 — 2022-01-29

## README

# FirErr

FirErr is a package for catching Firebase Errors that often occurs. Firebase can only send one response at a time, so catching it _one-by-one_ is not that bad, I think.

## 🤔 Usage

You can use it by defining a state, or variables that store the Firebase Error Message :

```
import { useState } from "react";

const [formError, setFormError] = useState("");
```

Then do some 🔥 Firebase Stuff :

```js
async function login(e) {
    e.preventDefault();
    await createUserWithEmailAndPassword(auth, formEmail, formPassword)
        .then(() => {
            // finish
        })
        .catch((error) => {
            const code = error.code;
            firerr(code, formError);
        });
}
```

## `firerrString()` function

```js
import { firerrString } from "firerr";

async function login(e) {
    e.preventDefault();
    await createUserWithEmailAndPassword(auth, formEmail, formPassword)
        .then(() => {
            // finish
        })
        .catch((error) => {
            const code = error.code;
            alert(firerrString(code));
        });
}
```

> 🥶 Idk who install this package tho...
> This is my very first NPM Package.
> I am very sorry if there's a problem! I'm only 14 yo, 15 next September 🤧
>
> \- qwyzex, 2022

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