forbidden-error

A simple ForbiddenError constructor

Usage no npm install needed!

<script type="module">
  import forbiddenError from 'https://cdn.skypack.dev/forbidden-error';
</script>

README

ForbiddenError

When you can't get something

Dependency Status devDependency Status

An exception for use in certain situations (e.g. to signal HTTP 403 error). Created because of a need for a cross-package standard exception.

Getting started

Install the package with this command:

npm install forbidden-error --save

Usage

// Import ES6-style
import ForbiddenError from 'forbidden-error';

// Or CommonJS-style
const ForbiddenError = require('forbidden-error');

// Then just use like this:
throw new ForbiddenError();

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style.

License

Copyright (c) 2016 Rafał Ruciński. Licensed under the WTFPL license.