xero-node
Advanced tools
Comparing version 2.14.0 to 2.15.0
@@ -147,2 +147,3 @@ 'use strict'; | ||
var errObj = new Error(method.toUpperCase() + ' call failed with: ' + err.statusCode); | ||
errObj.statusCode = err.statusCode; | ||
errObj.data = data; | ||
@@ -161,2 +162,3 @@ reject(errObj); | ||
var errObj = new Error(method.toUpperCase() + ' call failed with: ' + err.statusCode + ' and exception: ' + JSON.stringify(exception, null, 2)); | ||
errObj.statusCode = err.statusCode; | ||
reject(errObj); | ||
@@ -180,2 +182,3 @@ callback && callback(errObj); | ||
var errObj = new Error(method.toUpperCase() + ' call failed with: ' + err.statusCode); | ||
errObj.statusCode = err.statusCode; | ||
errObj.data = err.data; | ||
@@ -215,2 +218,3 @@ reject(errObj); | ||
var errObj = new Error('DELETE call failed with: ' + err.statusCode); | ||
errObj.statusCode = err.statusCode; | ||
errObj.data = data; | ||
@@ -224,2 +228,3 @@ reject(errObj); | ||
var errObj = new Error('DELETE call failed with: ' + err.statusCode + ' and message: ' + err.data); | ||
errObj.statusCode = err.statusCode; | ||
reject(errObj); | ||
@@ -245,2 +250,3 @@ callback && callback(errObj); | ||
var errObj = new Error('DELETE call failed with: ' + err.statusCode); | ||
errObj.statusCode = err.statusCode; | ||
errObj.data = err.data; | ||
@@ -287,2 +293,3 @@ reject(errObj); | ||
var errObj = new Error('GET call failed with: ' + err.statusCode); | ||
errObj.statusCode = err.statusCode; | ||
errObj.data = err.data; | ||
@@ -319,3 +326,3 @@ reject(errObj); | ||
} | ||
if (!_.isEmpty(params)) { | ||
@@ -341,2 +348,3 @@ url += '?' + querystring.stringify(params); | ||
var errObj = new Error('GET call failed with: ' + err.statusCode); | ||
errObj.statusCode = err.statusCode; | ||
errObj.data = data; | ||
@@ -351,2 +359,3 @@ reject(errObj); | ||
var errObj = new Error('GET call failed with: ' + err.statusCode + ' and exception: ' + JSON.stringify(data.ApiException, null, 2)); | ||
errObj.statusCode = err.statusCode; | ||
reject(errObj); | ||
@@ -395,2 +404,3 @@ callback && callback(errObj); | ||
var errObj = new Error('GET call failed with: ' + err.statusCode); | ||
errObj.statusCode = err.statusCode; | ||
errObj.data = err.data; | ||
@@ -416,2 +426,3 @@ reject(errObj); | ||
var errObj = new Error('GET call failed with: ' + err.statusCode); | ||
errObj.statusCode = err.statusCode; | ||
errObj.data = dataParts; | ||
@@ -423,2 +434,3 @@ reject(errObj); | ||
var errObj = new Error('GET call failed with: ' + err.statusCode); | ||
errObj.statusCode = err.statusCode; | ||
reject(errObj); | ||
@@ -491,3 +503,2 @@ callback && callback(errObj); | ||
.catch(function(err) { | ||
console.error(err); | ||
throw err; | ||
@@ -513,3 +524,2 @@ }) | ||
.catch(function(err) { | ||
console.error(err); | ||
throw err; | ||
@@ -516,0 +526,0 @@ }) |
{ | ||
"name": "xero-node", | ||
"version": "2.14.0", | ||
"version": "2.15.0", | ||
"description": "Xero API Wrapper for all application types", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -231,2 +231,4 @@ xero-node (alpha) | ||
* 2.15.0 | ||
- Adds 'statusCode' property to errors returned from API calls #153 | ||
* 2.14.0 | ||
@@ -233,0 +235,0 @@ - Make npm the default over yarn #136 |
@@ -75,2 +75,3 @@ 'use strict'; | ||
); | ||
importTest('error_tests', `${__dirname}/core/error_tests.js`); | ||
}); | ||
@@ -77,0 +78,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
645677
162
11937
487