rc@73: # errorhandler rc@73: rc@73: [![NPM version](https://badge.fury.io/js/errorhandler.svg)](http://badge.fury.io/js/errorhandler) rc@73: [![Build Status](https://travis-ci.org/expressjs/errorhandler.svg?branch=master)](https://travis-ci.org/expressjs/errorhandler) rc@73: [![Coverage Status](https://img.shields.io/coveralls/expressjs/errorhandler.svg?branch=master)](https://coveralls.io/r/expressjs/errorhandler) rc@73: rc@73: Previously `connect.errorHandler()`. rc@73: rc@73: ## Install rc@73: rc@73: ```sh rc@73: $ npm install errorhandler rc@73: ``` rc@73: rc@73: ## API rc@73: rc@73: ### errorhandler() rc@73: rc@73: Create new middleware to handle errors and respond with content negotiation. rc@73: This middleware is only intended to be used in a development environment, as rc@73: the full error stack traces will be send back to the client when an error rc@73: occurs. rc@73: rc@73: ## Example rc@73: rc@73: ```js rc@73: var connect = require('connect') rc@73: var errorhandler = require('errorhandler') rc@73: rc@73: var app = connect() rc@73: rc@73: if (process.env.NODE_ENV === 'development') { rc@73: app.use(errorhandler()) rc@73: } rc@73: ``` rc@73: rc@73: ## License rc@73: rc@73: The MIT License (MIT) rc@73: rc@73: Copyright (c) 2014 Jonathan Ong me@jongleberry.com rc@73: rc@73: Permission is hereby granted, free of charge, to any person obtaining a copy rc@73: of this software and associated documentation files (the "Software"), to deal rc@73: in the Software without restriction, including without limitation the rights rc@73: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell rc@73: copies of the Software, and to permit persons to whom the Software is rc@73: furnished to do so, subject to the following conditions: rc@73: rc@73: The above copyright notice and this permission notice shall be included in rc@73: all copies or substantial portions of the Software. rc@73: rc@73: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR rc@73: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, rc@73: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE rc@73: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER rc@73: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, rc@73: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN rc@73: THE SOFTWARE.