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

backandsdk

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backandsdk - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

test/errorFormatTest.js

27

backand.js

@@ -174,7 +174,30 @@ /*

};
BackandSdk.prototype.formatErrorMessage = function(response, error) {
var str = "";
if(response.statusCode){
str += 'Status code: "' + response.statusCode + " ";
}
if(typeof response.body === 'object'){
str += JSON.stringify(response.body);
}else {
str += response.body;
}
str += " ";
if(response.request && response.request.href) {
str += ' requestUrl: ' + response.request.href;
}
if(error) {
str += error;
}
return str;
}
BackandSdk.prototype.handleResponse = function (deferred, error, response, data) {
if (error || response.statusCode != 200) {
error = 'Status code: "' + response.statusCode + ' "' +
typeof response.body === 'object' ? JSON.stringify(response.body) : response.body + (response.request ? ' requestUrl: ' + response.request.href : '');
error = this.formatErrorMessage(response, error);
console.error('Error: ', error);

@@ -181,0 +204,0 @@ deferred.reject(error);

2

package.json
{
"name": "backandsdk",
"version": "0.1.5",
"version": "0.1.6",
"description": "Backand sdk for node.js",

@@ -5,0 +5,0 @@ "author": "Ygal Bellaiche",

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