Socket
Socket
Sign inDemoInstall

twilio

Package Overview
Dependencies
Maintainers
1
Versions
301
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twilio - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

20

lib/RestClient.js

@@ -106,10 +106,16 @@ /**

if (callback) {
var data = err || !body ? {} : JSON.parse(body);
var data;
try {
data = err || !body ? {status: 500, message: 'Empty body'} : JSON.parse(body);
} catch (e) {
data = { status: 500, message: (e.message || 'Invalid JSON body') };
}
//request doesn't think 4xx is an error - we want an error for any non-2xx status codes
if (!err && (response.statusCode < 200 || response.statusCode > 206)) {
err = data ? data : {
status: response.statusCode,
message:'HTTP request error, check response for more info'
};
var error = null;
if (err || (response.statusCode < 200 || response.statusCode > 206)) {
error = { status: response.statusCode };
error.message = data ? data.message : 'HTTP request error, check response for more info';
error.code = data && data.code;
error.moreInfo = data && data.more_info;
}

@@ -152,3 +158,3 @@

callback.call(client, err, data, response);
callback.call(client, error, data, response);
}

@@ -155,0 +161,0 @@ });

{
"name":"twilio",
"description":"A Twilio helper library",
"version":"1.1.2",
"version":"1.1.3",
"author":"Kevin Whinnery <kevin.whinnery@gmail.com>",

@@ -6,0 +6,0 @@ "contributors":[

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