0.1.2 • Published 5 years ago

@maxtruxa/http-error v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@maxtruxa/http-error

npm Version npm Downloads Test Status Test Coverage MIT Licensed

HttpError.

This README needs some love.

const HttpError = require('@maxtruxa/http-error');

throw new HttpError(404, {url: 'https://example.com/test'});

Installing

npm install @maxtruxa/http-error

Features

Usage

Direct Usage

const HttpError = require('@maxtruxa/http-error');

// HttpError(code[, message][, properties])
// HttpError(properties)

throw new HttpError(404);
throw new HttpError(404, 'some message');
throw new HttpError(404, {additional: 'information'});
throw new HttpError(404, 'some message', {additional: 'information'});
throw new HttpError({code: 404, additional: 'information'});

Inheriting

API

Tests

To run the test suite, install dependencies, then run npm test:

npm install
npm test

Coverage reports are generated by running npm run coverage. Linting is done with npm run lint.