@serverless/sdk
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.4.1](https://github.com/serverless/console/compare/@serverless/sdk@0.4.0...@serverless/sdk@0.4.1) (2023-01-26) | ||
### Features | ||
- Cover each `console.error` invocation with captured event ([c37ef74](https://github.com/serverless/console/commit/c37ef74094d8012570364572be69eaf633b44227)) | ||
- Store stack trace with each captured error and warning ([eadaafa](https://github.com/serverless/console/commit/eadaafa7f8b3258996e5a16d826bada94fa7f85c)) | ||
## [0.4.0](https://github.com/serverless/console/compare/@serverless/sdk@0.3.1...@serverless/sdk@0.4.0) (2023-01-19) | ||
@@ -7,0 +14,0 @@ |
@@ -7,2 +7,3 @@ 'use strict'; | ||
const CapturedEvent = require('./captured-event'); | ||
const resolveStackTraceString = require('./resolve-stack-trace-string'); | ||
@@ -30,3 +31,2 @@ const resolveNonErrorName = (value) => { | ||
tags.message = error.message; | ||
tags.stacktrace = error.stack; | ||
} else { | ||
@@ -36,2 +36,3 @@ tags.name = resolveNonErrorName(error); | ||
} | ||
tags.stacktrace = resolveStackTraceString(error); | ||
capturedEvent.tags.setMany(tags, { prefix: 'error' }); | ||
@@ -38,0 +39,0 @@ |
@@ -6,2 +6,3 @@ 'use strict'; | ||
const CapturedEvent = require('./captured-event'); | ||
const resolveStackTraceString = require('./resolve-stack-trace-string'); | ||
@@ -17,5 +18,9 @@ module.exports = (message, options = {}) => { | ||
customFingerprint: options.fingerprint, | ||
tags: { 'warning.message': message, 'warning.type': options.type || 1 }, | ||
tags: { | ||
'warning.message': message, | ||
'warning.type': options.type || 1, | ||
'warning.stacktrace': resolveStackTraceString(), | ||
}, | ||
_origin: options._origin, | ||
}); | ||
}; |
@@ -14,3 +14,3 @@ 'use strict'; | ||
const resolveWarnMesssage = (args) => { | ||
const resolveMessage = (args) => { | ||
let message = ''; | ||
@@ -35,5 +35,6 @@ const argsLength = args.length; | ||
original.error.apply(this, args); | ||
const error = args.find(isError); | ||
if (!error) return; | ||
createErrorCapturedEvent(error, { _origin: 'nodeConsole' }); | ||
createErrorCapturedEvent( | ||
args.length === 1 && isError(args[0]) ? args[0] : resolveMessage(args), | ||
{ _origin: 'nodeConsole' } | ||
); | ||
}; | ||
@@ -46,3 +47,3 @@ | ||
} else { | ||
createWarningCapturedEvent(resolveWarnMesssage(args), { _origin: 'nodeConsole' }); | ||
createWarningCapturedEvent(resolveMessage(args), { _origin: 'nodeConsole' }); | ||
} | ||
@@ -49,0 +50,0 @@ }; |
{ | ||
"name": "@serverless/sdk", | ||
"repository": "serverless/console", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"author": "Serverless, Inc.", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59733
33
1159