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

nylas

Package Overview
Dependencies
Maintainers
10
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nylas - npm Package Compare versions

Comparing version 6.4.0 to 6.4.1

50

lib/nylas-connection.js

@@ -196,26 +196,18 @@ "use strict";

if (response.status > 299) {
return response
.clone()
.json()
.then(function (body) {
var error = new nylas_api_error_1.default(response.status, body.type, body.message);
if (body.missing_fields) {
error.missingFields = body.missing_fields;
return response.text().then(function (body) {
try {
var parsedApiError = JSON.parse(body);
var error = new nylas_api_error_1.default(response.status, parsedApiError.type, parsedApiError.message);
if (parsedApiError.missing_fields) {
error.missingFields = parsedApiError.missing_fields;
}
if (parsedApiError.server_error) {
error.serverError = parsedApiError.server_error;
}
return reject(error);
}
if (body.server_error) {
error.serverError = body.server_error;
catch (e) {
var error = new nylas_api_error_1.default(response.status, response.statusText, body);
return reject(error);
}
return reject(error);
})
.catch(function () {
return response
.text()
.then(function (text) {
var error = new nylas_api_error_1.default(response.status, response.statusText, text);
return reject(error);
})
.catch(function () {
var error = new nylas_api_error_1.default(response.status, response.statusText, 'Error encountered during request, unable to extract error message.');
return reject(error);
});
});

@@ -248,8 +240,10 @@ }

else {
return response
.clone()
.json()
.catch(function () { return response.text(); })
.then(function (data) { return resolve(data); })
.catch(function () { return resolve(undefined); });
return response.text().then(function (text) {
try {
return resolve(JSON.parse(text));
}
catch (e) {
return resolve(text);
}
});
}

@@ -256,0 +250,0 @@ }

{
"name": "nylas",
"version": "6.4.0",
"version": "6.4.1",
"description": "A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.",

@@ -5,0 +5,0 @@ "main": "lib/nylas.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