Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

error-handler-e2

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

error-handler-e2 - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

26

desc_errors.js
const spec_errors = [
{
statusCode: 400,
message: "Bad Request",
message: "400 Bad Request",
description: `

@@ -17,3 +17,3 @@ The request could not be understood by the server due to malformed syntax.

statusCode: 401,
message: "Unauthorized",
message: "401 Unauthorized",
description: `

@@ -44,3 +44,3 @@ The request requires user authentication. The response MUST include a

statusCode: 402,
message: "Payment Required",
message: "402 Payment Required",
description: `

@@ -60,3 +60,3 @@ This code is reserved for future use.

statusCode: 403,
message: "Forbidden",
message: "403 Forbidden",
description: `

@@ -82,3 +82,3 @@ The server understood the request, but is refusing to fulfill it.

statusCode: 404,
message: "Not Found",
message: "404 Not Found",
description: `

@@ -104,3 +104,3 @@ The server has not found anything matching the Request-URI.

statusCode: 405,
message: "Method Not Allowed",
message: "405 Method Not Allowed",
description: `

@@ -120,3 +120,3 @@ The method specified in the Request-Line is not allowed for

statusCode: 406,
message: 'Not Acceptable',
message: '406 Not Acceptable',
description: `

@@ -152,3 +152,3 @@ The resource identified by the request is only capable of generating

statusCode: 407,
message: 'Proxy Authentication Required',
message: '407 Proxy Authentication Required',
description: `

@@ -169,3 +169,3 @@ This code is similar to 401 (Unauthorized), but indicates that

statusCode: 408,
message: 'Request Timeout',
message: '408 Request Timeout',
description: `

@@ -185,3 +185,3 @@ The client did not produce a request within the time that the server

statusCode: 409,
message: `Conflict`,
message: `409 Conflict`,
description: `

@@ -214,3 +214,3 @@ The request could not be completed due to a conflict with the current

statusCode: 410,
message: `Gone`,
message: `410 Gone`,
description: `

@@ -247,3 +247,3 @@ The requested resource is no longer available at the server and

statusCode: 411,
message: `Length Required`,
message: `411 Length Required`,
description: `

@@ -262,3 +262,3 @@ The server refuses to accept the request without a defined

statusCode: 412,
message: `Precondition Failed`,
message: `412 Precondition Failed`,
description: `

@@ -265,0 +265,0 @@ The precondition given in one or more of the request-header

{
"name": "error-handler-e2",
"version": "2.1.2",
"version": "2.1.3",
"description": "This is handle error package",

@@ -26,5 +26,5 @@ "main": "index.js",

],
"dependencies": {
"devDependencies": {
"mocha": "^8.0.1"
}
}

@@ -14,3 +14,3 @@ # Error Handler E2

//or
yarn add npm i error-handler-e2
yarn add error-handler-e2

@@ -23,13 +23,33 @@ const ErrorHandlerrE2 = require("error-handler-e2");

## Examples
* Using Functions
* create custom error
### Using Functions
1. create custom error
```
const { functions } = require("error-handler-e2");
const myError =vfunction.customError({message: "Testing Error Message",
statusCode: 404, {...options}});
const { customError } = require("error-handler-e2").functions;
const myError = customError({
message: "testing erro",
statusCode: 404,
});
```
2. Logging Errors
```
const { customError, logErrors } = require("error-handler-e2").functions;
const myError = customError({
message: "testing erro",
statusCode: 404,
});
logErrors({
error: err,
file: "index.js",
path: `${__dirname}/${__filename}`,
});
```
## Authors
[Milad](<https://github.com/miladezzat>)
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc