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

@serverless/sdk

Package Overview
Dependencies
Maintainers
6
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serverless/sdk - npm Package Compare versions

Comparing version 0.4.3 to 0.4.4

12

CHANGELOG.md

@@ -5,2 +5,14 @@ # Changelog

### [0.4.4](https://github.com/serverless/console/compare/@serverless/sdk@0.4.3...@serverless/sdk@0.4.4) (2023-02-01)
### Bug Fixes
- Do not define `undefined` properties in structured error ([37e2491](https://github.com/serverless/console/commit/37e2491b9c0baa8ea606db1d1e595bccbb9e6d8a))
- Ensure to unpack structured SDK errors for captured events ([b0ecd2b](https://github.com/serverless/console/commit/b0ecd2ba17eb6cb4b238b6518f7c1f0c882b2be1))
### Maintenance Improvements
- Improve stack trace presentation in SDK error ([40c3930](https://github.com/serverless/console/commit/40c3930796b8783bfbc565df9182d7f2c977138a))
- Report stack trace with simpler `stack` property ([a6f4604](https://github.com/serverless/console/commit/a6f46040e987524616f79088f90107df274224e5))
### [0.4.3](https://github.com/serverless/console/compare/@serverless/sdk@0.4.2...@serverless/sdk@0.4.3) (2023-01-30)

@@ -7,0 +19,0 @@

4

lib/create-error-captured-event.js

@@ -26,6 +26,6 @@ 'use strict';

} else {
tags.name = resolveNonErrorName(error);
tags.name = options._name || resolveNonErrorName(error);
tags.message = typeof error === 'string' ? error : util.inspect(error);
}
tags.stacktrace = resolveStackTraceString(error);
tags.stacktrace = options._stack || resolveStackTraceString(error);
capturedEvent.tags.setMany(tags, { prefix: 'error' });

@@ -32,0 +32,0 @@

@@ -36,6 +36,15 @@ 'use strict';

try {
createErrorCapturedEvent(
args.length === 1 && isError(args[0]) ? args[0] : resolveMessage(args),
{ _origin: 'nodeConsole' }
);
const input = args[0];
if (args.length === 1 && isPlainObject(input) && input.source === 'serverlessSdk') {
createErrorCapturedEvent(input.message, {
_name: input.name,
_stack: input.stack,
_origin: 'nodeConsole',
});
} else {
createErrorCapturedEvent(
args.length === 1 && isError(input) ? input : resolveMessage(args),
{ _origin: 'nodeConsole' }
);
}
} catch (error) {

@@ -42,0 +51,0 @@ reportSdkError(error);

@@ -6,2 +6,3 @@ 'use strict';

const resolveNonErrorName = require('./resolve-non-error-name');
const resolveStackTraceString = require('./resolve-stack-trace-string');

@@ -20,15 +21,14 @@ module.exports = (error, options = {}) => {

const type = options.type || 'INTERNAL';
console.error({
source: 'serverlessSdk',
type,
description:
type === 'INTERNAL'
? 'Internal Serverless SDK Error. ' +
'Please report at https://github.com/serverless/console/issue'
: undefined,
name,
message,
code: error && error.code,
stackTrace: error && error.stack,
});
const errorData = { source: 'serverlessSdk', type };
if (type === 'INTERNAL') {
errorData.description =
'Internal Serverless SDK Error. ' +
'Please report at https://github.com/serverless/console/issue';
}
errorData.name = name;
errorData.message = message;
if (error.code) errorData.code = error.code;
if (error.stack) errorData.stack = resolveStackTraceString(error);
console.error(errorData);
};
{
"name": "@serverless/sdk",
"repository": "serverless/console",
"version": "0.4.3",
"version": "0.4.4",
"author": "Serverless, Inc.",

@@ -6,0 +6,0 @@ "dependencies": {

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