Error Handler
npm install @rapharacing/error-handler


[![MIT License][license-image]][license-url]
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: https://gitlab.com/rapharacing/rapha-front-end/error-handler/-/blob/master/LICENCE.md
Transform and translated error messages for client-side applications and middlware.
- Babel - Write next generation JavaScript today.
- Jest - JavaScript testing framework used by Facebook.
- ESLint - Make sure you are writing a quality code.
- Prettier - Enforces a consistent style by parsing your code and re-printing it.
- Travis CI - Automate tests and linting for every push or pull request.
- Documentation - A documentation system so good, you'll actually write documentation.
- Standard Version - Automate versioning and CHANGELOG generation.
#### Table of Contents
- getError
- Parameters
Returns a transformed and translated error message for the FE or MW. These can be further tailored for Customer service by passing an optional param
#### Parameters
- error String Error string
- locale String Locale string
- cs Boolean Customer service boolean
Returns String Translated error message string
``js
import getError from "@rapharacing/error-handler";
const error = getError("AccessDeniedException", "en");
`
`sh``
$ yarn test # run tests with Jest
$ yarn coverage # run tests with coverage and open it on browser
$ yarn lint # lint code
$ yarn docs # generate docs
$ yarn build # generate docs and transpile code