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

http-call

Package Overview
Dependencies
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-call - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

25

lib/http.js

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

});
exports.HTTPError = undefined;

@@ -193,11 +194,3 @@ var _util = require('util');

};
this.HTTPError = class HTTPError extends Error {
constructor(http, body) {
body = `\n${_util2.default.inspect(body)}`;
super(`HTTP Error ${http.response.statusCode} for ${http.method} ${http.url}${body}`);
this.statusCode = http.response.statusCode;
}
};
if (!url) throw new Error('no url provided');

@@ -224,3 +217,3 @@ this.options = options;

if (!this.raw) this.body = await this.parse(this.response);
} else throw new this.HTTPError(this, (await this.parse(this.response)));
} else throw new HTTPError(this, (await this.parse(this.response)));
}

@@ -258,4 +251,16 @@

}
}
exports.default = HTTP;
class HTTPError extends Error {
constructor(http, body) {
let message;
if (typeof body === 'string' || typeof body.message === 'string') message = body.message || body;else message = _util2.default.inspect(body);
super(`HTTP Error ${http.response.statusCode} for ${http.method} ${http.url}\n${message}`);
this.statusCode = http.response.statusCode;
this.http = http;
this.body = body;
}
}
exports.default = HTTP;
exports.HTTPError = HTTPError;

4

package.json
{
"name": "http-call",
"description": "make http requests",
"version": "1.2.0",
"version": "1.2.1",
"author": "Jeff Dickey @dickeyxxx",
"bugs": "https://github.com/dickeyxxx/http-call/issues",
"dependencies": {
"debug": "^2.x",
"debug": "^2.6.8",
"tunnel-agent": "^0.6.0"

@@ -10,0 +10,0 @@ },

Sorry, the diff of this file is not supported yet

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