Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the failing tests and release 3.0.6 #46

Merged
merged 5 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/error/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const Promise = require('promiscuous');
const Config = require('../configuration');
const _ = require('lodash');

let tags = [];

Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lambda-foundation",
"version": "3.0.4",
"version": "3.0.6",
"description": "Common helpers for Lambda backed microservices",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions test/error-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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 set correctly');
t.same(err.request, expectedRequest, 'Request data preserved');
t.end();
});
Expand Down