Comparing version 5.1.1 to 5.1.2
@@ -0,1 +1,8 @@ | ||
### v5.1.2 (2021-03-29) | ||
#### 🐛 Bug Fixes | ||
* [#121](https://github.com/groupon/gofer/pull/121) fix: guard asyncStack capturing with captureAsyncStack option ([@aaarichter](https://github.com/aaarichter)) | ||
### v5.1.1 (2021-03-26) | ||
@@ -2,0 +9,0 @@ |
@@ -243,2 +243,3 @@ /* | ||
pathParams: options.pathParams, | ||
captureAsyncStack: options.captureAsyncStack, | ||
}); | ||
@@ -245,0 +246,0 @@ } |
@@ -151,4 +151,4 @@ /* | ||
async function trackError(fn) { | ||
const stack = new Error().stack; | ||
async function trackError(fn, opts) { | ||
const stack = opts.captureAsyncStack ? new Error().stack : ''; | ||
@@ -158,3 +158,5 @@ try { | ||
} catch (e) { | ||
e.stack = `${e.stack}\n${stack.substring(stack.indexOf('\n') + 1)}`; | ||
if (stack) { | ||
e.stack = `${e.stack}\n${stack.substring(stack.indexOf('\n') + 1)}`; | ||
} | ||
throw e; | ||
@@ -363,5 +365,8 @@ } | ||
function request(options) { | ||
const result = trackError(() => new Promise(requestFunc.bind(null, options))); | ||
const result = trackError( | ||
() => new Promise(requestFunc.bind(null, options)), | ||
options | ||
); | ||
return Object.defineProperties(result, reqProperties); | ||
} | ||
module.exports = request; |
@@ -65,2 +65,3 @@ import { SecureContext } from 'tls'; | ||
secureContext?: SecureContext; | ||
captureAsyncStack?: boolean; | ||
[opt: string]: any; | ||
@@ -67,0 +68,0 @@ }; |
{ | ||
"name": "gofer", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"description": "A general purpose service client library", | ||
@@ -5,0 +5,0 @@ "license": "BSD-3-Clause", |
[![nlm-github](https://img.shields.io/badge/github-groupon%2Fgofer%2Fissues-F4D03F?logo=github&logoColor=white)](https://github.com/groupon/gofer/issues) | ||
![nlm-node](https://img.shields.io/badge/node-%3E%3D10.13-blue?logo=node.js&logoColor=white) | ||
![nlm-version](https://img.shields.io/badge/version-5.1.1-blue?logo=version&logoColor=white) | ||
![nlm-version](https://img.shields.io/badge/version-5.1.2-blue?logo=version&logoColor=white) | ||
[![Build Status](https://travis-ci.com/groupon/gofer.svg?branch=main)](https://travis-ci.com/groupon/gofer) | ||
@@ -5,0 +5,0 @@ |
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
80713
1360