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

ibm-blockchain-js

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ibm-blockchain-js - npm Package Compare versions

Comparing version 1.2.6 to 1.2.7

20

lib/rest.js

@@ -12,4 +12,4 @@ 'use strict';

/*
Version: 0.6.5
Updated: 5/23/2015
Version: 0.6.6
Updated: 8/05/2016
-----------------------------------------------------------------

@@ -96,3 +96,3 @@ Use: var rest = require('./rest');

//main http request builder/handler/thingy
function http(options, parameters, body){
function http(options, parameters, body, attempt){
var acceptJson = false, jQuery = false, nodeJs = false, http, http_txt = '', goodJSON = false;

@@ -104,2 +104,3 @@ var ids = 'abcdefghijkmnopqrstuvwxyz';

if(!attempt || isNaN(attempt)) attempt = 1; //defaults to attempt # 1
options = mergeBtoA(default_options, options);

@@ -217,8 +218,15 @@

request.on('error', function(e) { //handle error event
if(!options.quiet) logger.error(http_txt + ' Error - unknown issue with request: ', e); //catch failed request (failed DNS lookup and such)
failure(500, null, e);
if(e.code === 'ECONNRESET' && attempt < 8) { //try ECONNRESET's again
if(!options.quiet) logger.warn(http_txt + ' Warning - detected ECONNRESET, will try HTTP req again. attempt:' + attempt);
attempt++;
return setTimeout(function(){ http(options, parameters, body); }, 250 * Math.pow(2, attempt));
}
else {
if(!options.quiet) logger.error(http_txt + ' Error - unknown issue with request: ', e); //catch failed request (failed DNS lookup and such)
failure(500, null, e);
}
});
request.setTimeout(Number(options.timeout) || default_options.timeout);
request.on('timeout', function(){ //handle time out event
request.on('timeout', function(){ //handle time out events
if(!options.quiet) logger.error(http_txt + ' Error - request timed out');

@@ -225,0 +233,0 @@ failure(408, null, 'Request timed out');

{
"name": "ibm-blockchain-js",
"version": "1.2.6",
"version": "1.2.7",
"description": "A library for easily interacting with IBM Blockchain.",

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

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