Natural Preference for Minification

    This package has been deprecated

    Author message:

    This package has moved to the @mapbox namespace. All new versions are available via @mapbox/mapbox-error

    mapbox-error

    2.2.0 • Public • Published

    Build Status

    Generic error middleware for express apps

    usage:

    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

    Keywords

    none

    Install

    npm i mapbox-error

    DownloadsWeekly Downloads

    651

    Version

    2.2.0

    License

    ISC

    Last publish

    Collaborators

    • ajashton
    • alulsh
    • amyleew
    • ansis
    • arunasank
    • bhousel
    • bsudekum
    • danieljh
    • dnomadb
    • emilymcafee
    • freenerd
    • geohacker
    • ghoshkaj
    • gretacb
    • ian29
    • ianshward
    • ingalls
    • isiyu
    • jfirebaugh
    • jrpruit1
    • karenzshea
    • kkaefer
    • lbud
    • lxbarth
    • lyzidiamond
    • mapbox-admin
    • mapbox-machine-user
    • mapbox-npm
    • mapbox-npm-01
    • mapbox-npm-02
    • mapbox-npm-03
    • mapbox-npm-04
    • mapbox-npm-05
    • mapbox-npm-06
    • mapbox-npm-07
    • mapbox-npm-08
    • mapbox-npm-09
    • mapbox-npm-advanced-actions
    • mapbox-npm-ci
    • mapsam
    • mcwhittemore
    • miccolis
    • mollymerp
    • morganherlocker
    • mourner
    • mtirwin
    • nickidlugash
    • planemad
    • rclark
    • samanbb
    • sgillies
    • springmeyer
    • tcql
    • themarex
    • tristen
    • willwhite
    • yhahn
    • zmully