Socket
Socket
Sign inDemoInstall

http-errors

Package Overview
Dependencies
2
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.1 to 1.4.0

9

HISTORY.md

@@ -0,1 +1,10 @@

2016-01-28 / 1.4.0
==================
* Add `HttpError` export, for `err instanceof createError.HttpError`
* deps: inherits@2.0.1
* deps: statuses@'>= 1.2.1 < 2'
- Fix message for status 451
- Remove incorrect nginx status code
2015-02-02 / 1.3.1

@@ -2,0 +11,0 @@ ==================

10

index.js

@@ -67,2 +67,8 @@

var HttpError = exports.HttpError = function HttpError() {
throw new TypeError('cannot construct abstract class');
};
inherits(HttpError, Error);
// create generic error objects

@@ -90,3 +96,3 @@ var codes = statuses.codes.filter(function (num) {

}
inherits(ServerError, Error);
inherits(ServerError, HttpError);
ServerError.prototype.status =

@@ -112,3 +118,3 @@ ServerError.prototype.statusCode = code;

}
inherits(ClientError, Error);
inherits(ClientError, HttpError);
ClientError.prototype.status =

@@ -115,0 +121,0 @@ ClientError.prototype.statusCode = code;

10

package.json
{
"name": "http-errors",
"description": "Create HTTP error objects",
"version": "1.3.1",
"version": "1.4.0",
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",

@@ -13,8 +13,8 @@ "contributors": [

"dependencies": {
"inherits": "~2.0.1",
"statuses": "1"
"inherits": "2.0.1",
"statuses": ">= 1.2.1 < 2"
},
"devDependencies": {
"istanbul": "0",
"mocha": "1"
"istanbul": "0.4.2",
"mocha": "1.21.5"
},

@@ -21,0 +21,0 @@ "engines": {

@@ -26,4 +26,7 @@ # http-errors

All errors inherit from JavaScript `Error` and the exported `createError.HttpError`.
### Error Properties
- `expose` - can be used to signal if `message` should be sent to the client, defaulting to `false` when `status` >= 500
- `message`

@@ -58,3 +61,3 @@ - `status` and `statusCode` - the status code of the error, defaulting to `500`

[node-version-image]: https://img.shields.io/node/v/http-errors.svg?style=flat
[node-version-url]: http://nodejs.org/download/
[node-version-url]: https://nodejs.org/en/download/
[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg?style=flat

@@ -61,0 +64,0 @@ [travis-url]: https://travis-ci.org/jshttp/http-errors

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc