@bluejay/rest-errors

Errors with status codes and more.

Usage no npm install needed!

<script type="module">
  import bluejayRestErrors from 'https://cdn.skypack.dev/@bluejay/rest-errors';
</script>

README

RestErrors

npm npm npm

Rest oriented set of errors.

Requirements

  • node >= 8.6, tested with:
  • node@8.6.0
  • node@12.8.1
  • typescript >= 4.0, tested with:
  • typescript@4.0.2

Installation

npm i @bluejay/rest-errors;

Usage

import * as RestErrors from '@bluejay/rest-errors';

const err = new RestErrors.BadRequest('Something went wrong.', { some: { meta: 'data' } });
RestErrors.isRestError(err); // true

Documentation

See Github Pages.