errorhandler
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -0,1 +1,6 @@ | ||
1.0.2 / 2014-06-05 | ||
================== | ||
* Pass on errors from reading error files | ||
1.0.1 / 2014-04-29 | ||
@@ -2,0 +7,0 @@ ================== |
/*! | ||
* Connect - errorHandler | ||
* errorhandler | ||
* Copyright(c) 2010 Sencha Inc. | ||
@@ -58,3 +58,5 @@ * Copyright(c) 2011 TJ Holowaychuk | ||
fs.readFile(__dirname + '/public/style.css', 'utf8', function(e, style){ | ||
if (e) return next(e); | ||
fs.readFile(__dirname + '/public/error.html', 'utf8', function(e, html){ | ||
if (e) return next(e); | ||
var stack = (err.stack || '') | ||
@@ -61,0 +63,0 @@ .split('\n').slice(1) |
{ | ||
"name": "errorhandler", | ||
"description": "connect's default error handler page", | ||
"version": "1.0.1", | ||
"author": { | ||
"name": "Jonathan Ong", | ||
"email": "me@jongleberry.com", | ||
"url": "http://jongleberry.com", | ||
"twitter": "https://twitter.com/jongleberry" | ||
}, | ||
"version": "1.0.2", | ||
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/expressjs/errorhandler.git" | ||
}, | ||
"bugs": { | ||
"mail": "me@jongleberry.com", | ||
"url": "https://github.com/expressjs/errorhandler/issues" | ||
}, | ||
"repository": "expressjs/errorhandler", | ||
"devDependencies": { | ||
"connect": "3", | ||
"istanbul": "0.2.10", | ||
"mocha": ">= 1.17.0 < 2", | ||
"should": ">= 3.0.0 < 4", | ||
"supertest": "*", | ||
"connect": "*" | ||
"should": "~4.0.1", | ||
"supertest": "~0.13.0" | ||
}, | ||
@@ -30,4 +19,6 @@ "engines": { | ||
"scripts": { | ||
"test": "mocha --reporter spec --require should" | ||
"test": "mocha --reporter dot test/", | ||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/", | ||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec test/" | ||
} | ||
} |
@@ -1,12 +0,35 @@ | ||
# Error Handler | ||
# errorhandler | ||
[![NPM version](https://badge.fury.io/js/errorhandler.svg)](http://badge.fury.io/js/errorhandler) | ||
[![Build Status](https://travis-ci.org/expressjs/errorhandler.svg?branch=master)](https://travis-ci.org/expressjs/errorhandler) | ||
[![Coverage Status](https://img.shields.io/coveralls/expressjs/errorhandler.svg?branch=master)](https://coveralls.io/r/expressjs/errorhandler) | ||
Previously `connect.errorHandler()`. | ||
[![Build Status](https://travis-ci.org/expressjs/errorhandler.svg?branch=master)](https://travis-ci.org/expressjs/errorhandler) | ||
## Install | ||
Usage: | ||
```sh | ||
$ npm install errorhandler | ||
``` | ||
## API | ||
### errorhandler() | ||
Create new middleware to handle errors and respond with content negotiation. | ||
This middleware is only intended to be used in a development environment, as | ||
the full error stack traces will be send back to the client when an error | ||
occurs. | ||
## Example | ||
```js | ||
var app = require('connect'); | ||
app.use(require('errorhandler')()) | ||
var connect = require('connect') | ||
var errorhandler = require('errorhandler') | ||
var app = connect() | ||
if (process.env.NODE_ENV === 'development') { | ||
app.use(errorhandler()) | ||
} | ||
``` | ||
@@ -13,0 +36,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6701
132
60
0
5
2
3