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

eh-api-client

Package Overview
Dependencies
Maintainers
2
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eh-api-client - npm Package Compare versions

Comparing version 0.42.0 to 0.42.1

14

lib/client.js

@@ -23,4 +23,5 @@ var

function buildError(res, data) {
function buildError(res, data, callerStack) {
var error = new Error();
error.callerStack = callerStack
Error.captureStackTrace(error, buildError)

@@ -40,3 +41,3 @@ error.stack = '(' + res.request.method + ' ' + res.request.uri.href + ') ' + error.stack

function buildNetworkError(origErr) {
function buildNetworkError(origErr, callerStack) {
var error = new NetworkError(origErr.code, origErr.requestParams);

@@ -46,3 +47,4 @@ error.retryInfo = origErr.retryInfo;

error.origErr = origErr
return error;
error.callerStack = callerStack
return error
}

@@ -136,2 +138,4 @@

Client.prototype.request = function(method, options, body, cb) {
const callerStack = new Error().stack
if(typeof body === "function") {

@@ -238,3 +242,3 @@ cb = body;

})
return reject(buildNetworkError(err));
return reject(buildNetworkError(err, callerStack));
}

@@ -248,3 +252,3 @@ emitRequestDone(res)

else {
return reject(buildError(res, data));
return reject(buildError(res, data, callerStack));
}

@@ -251,0 +255,0 @@ }

{
"name": "eh-api-client",
"version": "0.42.0",
"version": "0.42.1",
"description": "Node.js rest client",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -48,3 +48,3 @@ var

err.name.should.equal("ServerError");
err.stack.indexOf('http://localhost:' + SERVER_PORT + '/').should.equal(1)
err.stack.indexOf('http://localhost:' + SERVER_PORT + '/').should.equal(5)
res.statusCode.should.equal(503);

@@ -86,3 +86,3 @@ done();

client.get("/", function(err) {
err.stack.indexOf('http://localhost:' + SERVER_PORT + '/').should.equal(1)
err.stack.indexOf('http://localhost:' + SERVER_PORT + '/').should.equal(5)
err.name.should.equal("NetworkError");

@@ -89,0 +89,0 @@ err.message.should.equal("ESOCKETTIMEDOUT");

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