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

nodegate

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodegate - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

2

package.json
{
"name": "nodegate",
"description": "API gateway made simple, fast and easy to configure.",
"version": "1.3.1",
"version": "1.4.0",
"author": "Julien Martin <martin.julien82@gmail.com>",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -30,2 +30,3 @@ /**

const buildedUrl = urlBuilder(url);
const failStatusCodes = options.failStatusCodes || [400, 500];
return async (container) => {

@@ -42,8 +43,18 @@ try {

} catch (err) {
const body = err.response && err.response.body;
const statusCode = err.response ? err.response.statusCode : 500;
if (body && !failStatusCodes.includes(parseInt(`${`${statusCode}[0]`}00`, 10))) {
setBodyToContainer(body, container, options);
container.statusCode = statusCode;
return;
}
const error = new WorkflowError(err, err.response);
error.setContainer(container);
if (err.response && err.response.body) {
container.errorBody = err.response.body;
if (body) {
container.errorBody = body;
}
container.statusCode = err.response ? err.response.statusCode : 500;
container.statusCode = statusCode;
throw error;

@@ -50,0 +61,0 @@ }

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