newrelic 8.5.1 → 8.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NEWS.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### v8.5.2 (2021-11-09)
2
+
3
+ * Fixed issue where unhandled promise rejections were not getting logged as errors in a lambda execution
4
+
1
5
  ### v8.5.1 (2021-11-03)
2
6
 
3
7
  * Fixed bug where failure to retrieve CPU/Memory details for certain Linux distros could result in a crash.
@@ -82,8 +82,14 @@ class AwsLambda {
82
82
  // NOTE: This may be converted to holding onto a single ender function if only
83
83
  // one invocation is executing at a time.
84
84
  shim.wrap(process, 'emit', function wrapEmit(shim, emit) {
85
- return function wrappedEmit(ev) {
86
- if (ev === 'beforeExit') {
85
+ return function wrappedEmit(ev, error) {
86
+ // need to add error as uncaughtException to be used
87
+ // later to add to transaction errors
88
+ if (ev === 'unhandledRejection') {
89
+ uncaughtException = error
90
+ }
91
+
92
+ if (['beforeExit', 'unhandledRejection'].includes(ev)) {
87
93
  transactionEnders.forEach((ender) => {
88
94
  ender()
89
95
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newrelic",
3
- "version": "8.5.1",
3
+ "version": "8.5.2",
4
4
  "author": "New Relic Node.js agent team <nodejs@newrelic.com>",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [