From 9fe7730eb4c4126e412b59c44b22a0dc5884d63a Mon Sep 17 00:00:00 2001 From: hayk-simonyan Date: Tue, 26 Nov 2024 22:16:01 +0400 Subject: [PATCH 1/5] remove extra from error object --- lib/error/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/error/index.js b/lib/error/index.js index 3d65191..5c1776d 100644 --- a/lib/error/index.js +++ b/lib/error/index.js @@ -2,7 +2,6 @@ const Promise = require('promiscuous'); const Config = require('../configuration'); -const _ = require('lodash'); let tags = []; @@ -32,8 +31,7 @@ function report(error, additionalTags, extra) { // Need this wrapping so that our internal implementation can safely throw errors return new Promise(function(resolve) { console.log(error.nativeError ? error.nativeError : error); //eslint-disable-line no-console - error.extra = _.merge(extra || {}, error.extra); - console.log(error.extra); //eslint-disable-line no-console + console.log(extra); //eslint-disable-line no-console resolve(error); }); }).catch(function(err) { From 36e077bee876bf9b509c6f5c6da9c37e5c3e0f30 Mon Sep 17 00:00:00 2001 From: hayk-simonyan Date: Wed, 27 Nov 2024 12:15:48 +0400 Subject: [PATCH 2/5] update the error tests --- test/error-test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/error-test.js b/test/error-test.js index 222ea15..904f13b 100644 --- a/test/error-test.js +++ b/test/error-test.js @@ -2,7 +2,6 @@ const tape = require('tape'); const LambdaError = require('../lib/error'); -const _ = require('lodash'); // Add a TEST tag to our errors LambdaError.config({ @@ -31,7 +30,7 @@ tape.test('Error reporting with additional metadata', function(t) { const error = new LambdaError(expectedCode, expectedMessage, expectedExtra, expectedRequest); LambdaError.report(error, undefined, expectedAdditionalExtra).then(function(err) { - t.same(err.extra, _.merge(expectedAdditionalExtra, expectedExtra), 'Extra metadata merged correctly'); + t.same(err.extra, expectedExtra, 'Extra metadata merged correctly'); t.same(err.request, expectedRequest, 'Request data preserved'); t.end(); }); From c7d611ea5552293875f17f8dd6a6e1a4fac9e345 Mon Sep 17 00:00:00 2001 From: hayk-simonyan Date: Wed, 27 Nov 2024 12:16:29 +0400 Subject: [PATCH 3/5] update error desc --- test/error-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/error-test.js b/test/error-test.js index 904f13b..ab87dac 100644 --- a/test/error-test.js +++ b/test/error-test.js @@ -30,7 +30,7 @@ tape.test('Error reporting with additional metadata', function(t) { const error = new LambdaError(expectedCode, expectedMessage, expectedExtra, expectedRequest); LambdaError.report(error, undefined, expectedAdditionalExtra).then(function(err) { - t.same(err.extra, expectedExtra, 'Extra metadata merged correctly'); + t.same(err.extra, expectedExtra, 'Extra metadata set correctly'); t.same(err.request, expectedRequest, 'Request data preserved'); t.end(); }); From 1e8ebf35139f47ccadd823f7ebb4415223bc773b Mon Sep 17 00:00:00 2001 From: hayk-simonyan Date: Wed, 27 Nov 2024 12:21:46 +0400 Subject: [PATCH 4/5] 3.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 93f7fa8..b14a178 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lambda-foundation", - "version": "3.0.4", + "version": "3.0.5", "description": "Common helpers for Lambda backed microservices", "main": "index.js", "scripts": { From 16b2ede98cebf83932c67e86ddf99c76616fc57d Mon Sep 17 00:00:00 2001 From: hayk-simonyan Date: Wed, 27 Nov 2024 12:21:50 +0400 Subject: [PATCH 5/5] 3.0.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b14a178..db8b451 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lambda-foundation", - "version": "3.0.5", + "version": "3.0.6", "description": "Common helpers for Lambda backed microservices", "main": "index.js", "scripts": {