<commit_before>[![Build Status](https://travis-ci.org/mapbox/mapbox-error.svg)](https://travis-ci.org/mapbox/mapbox-error)

### Generic error middleware for express apps

#### usage:
``` javascript
var errors = require('mapbox-error');
var server = require('express')();

// use ErrorHTTP to associate a status code and message to an Error object
server.get('/error', function(req, res, next) {
  return next(new errors.ErrorHTTP(400, 'Error for the sake of errors');
});

// put these after other routes and uses have been defined
server.use(errors.showError);
server.use(errors.notFound);

```

#### test:

`npm test`
<commit_msg>Fix docs.<commit_after>[![Build Status](https://travis-ci.org/mapbox/mapbox-error.svg)](https://travis-ci.org/mapbox/mapbox-error)

### Generic error middleware for express apps

#### usage:
``` javascript
var errors = require('mapbox-error');
var ErrorHTTP = errors.ErrorHTTP;
var server = require('express')();

// use ErrorHTTP to associate a status code and message to an Error object
server.get('/error', function(req, res, next) {
  return next(new ErrorHTTP('Error for the sake of errors', 400);
});

// put these after other routes and uses have been defined
server.use(errors.showError);
server.use(errors.notFound);

```

#### test:

`npm test`

{'fraction_non_alphanumeric': 0.1592851592851593, 'fraction_numerical': 0.004662004662004662, 'mean_word_length': 4.9906976744186045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1576787', 'n_tokens_mistral': 409, 'n_tokens_neox': 392, 'n_words': 118}