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

@venncity/errors

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@venncity/errors - npm Package Compare versions

Comparing version 1.7.27 to 1.7.28-lambda-middleware.80

config/default.json

8

lib/cjs/errorHandler/errorHandler.js

@@ -19,5 +19,7 @@ "use strict";

const fast_safe_stringify_1 = __importDefault(require("fast-safe-stringify"));
const cls_hooked_1 = __importDefault(require("cls-hooked"));
const formatError_1 = require("../formatError/formatError");
const config = require('@venncity/nested-config')(__dirname);
function defaultServiceErrorFormatter(error) {
setErrorOnNamespace(error);
const originalError = error.originalError;

@@ -32,2 +34,8 @@ const body = formatError_1.handleErrorThrown(originalError);

exports.defaultServiceErrorFormatter = defaultServiceErrorFormatter;
function setErrorOnNamespace(error) {
const namespace = cls_hooked_1.default.getNamespace(config.get('clsNamespace.sequelize'));
if (namespace) {
namespace.set('error', error);
}
}
// It is expected from the service response to contain the message and the error metadata inside extensions object

@@ -34,0 +42,0 @@ function wrapResponseForGateway(body) {

@@ -13,5 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {

import jsonStringify from 'fast-safe-stringify';
import cls from 'cls-hooked';
import { handleErrorThrown } from '../formatError/formatError';
const config = require('@venncity/nested-config')(__dirname);
export function defaultServiceErrorFormatter(error) {
setErrorOnNamespace(error);
const originalError = error.originalError;

@@ -25,2 +27,8 @@ const body = handleErrorThrown(originalError);

}
function setErrorOnNamespace(error) {
const namespace = cls.getNamespace(config.get('clsNamespace.sequelize'));
if (namespace) {
namespace.set('error', error);
}
}
// It is expected from the service response to contain the message and the error metadata inside extensions object

@@ -27,0 +35,0 @@ function wrapResponseForGateway(body) {

7

package.json
{
"name": "@venncity/errors",
"version": "1.7.27",
"version": "1.7.28-lambda-middleware.80+76cbc9990",
"author": "Venn Engineering",

@@ -36,4 +36,5 @@ "main": "lib/cjs/index.js",

"@sentry/types": "^5.22.3",
"@venncity/nested-config": "^2.0.35",
"@venncity/nested-config": "^2.0.36-lambda-middleware.80+76cbc9990",
"@venncity/schema-consts": "^4.1.8",
"cls-hooked": "^4.2.2",
"fast-safe-stringify": "^2.0.7",

@@ -45,3 +46,3 @@ "joi": "^14.3.1",

},
"gitHead": "2071ce6c245a39411385b3512aaa49f833bc3407"
"gitHead": "76cbc999066d2a3545b7e137ef92674c3e8ca8c8"
}
import jsonStringify from 'fast-safe-stringify';
import cls from 'cls-hooked';
import { handleErrorThrown } from '../formatError/formatError';

@@ -7,2 +8,3 @@

export function defaultServiceErrorFormatter(error) {
setErrorOnNamespace(error);
const originalError = error.originalError;

@@ -17,2 +19,9 @@ const body = handleErrorThrown(originalError);

function setErrorOnNamespace(error) {
const namespace = cls.getNamespace(config.get('clsNamespace.sequelize'));
if (namespace) {
namespace.set('error', error);
}
}
// It is expected from the service response to contain the message and the error metadata inside extensions object

@@ -19,0 +28,0 @@ function wrapResponseForGateway(body) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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