@trayio/threadneedle
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -62,3 +62,3 @@ var when = require('when'); | ||
function (body) { resolve(formatResponse({}, body)); }, | ||
function (err) { resolve(formatResponse({}, err)); } | ||
function (err) { reject(formatResponse({}, err)); } | ||
); | ||
@@ -65,0 +65,0 @@ }); |
@@ -43,3 +43,3 @@ var when = require('when'); | ||
function (body) { resolve(formatResponse({}, body)); }, | ||
function (err) { resolve(formatResponse({}, err)); } | ||
function (err) { reject(formatResponse({}, err)); } | ||
); | ||
@@ -46,0 +46,0 @@ }); |
{ | ||
"name": "@trayio/threadneedle", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "A framework for simplifying working with HTTP-based APIs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -639,8 +639,15 @@ # threadneedle | ||
{ | ||
afterFailure: function (err, params) { | ||
if (err.response.statusCode === 429) { | ||
err.code = 'call_limit_exceeded'; | ||
} | ||
method: 'get', | ||
url: 'https://{{dc}}.api.mailchimp.com/2.0/users?apikey={{apiKey}}', | ||
expects: 200, | ||
afterHeaders: function (error, params, body, res) { | ||
return { | ||
operation: 'cleanup_op', | ||
data: { | ||
abc: '123' | ||
} | ||
}; | ||
// You can also return a promise which should resolve having modified the error | ||
// You can also return a promise to do async logic. It should resolve | ||
// with the header object. | ||
} | ||
@@ -696,2 +703,2 @@ } | ||
### addMethod - SOAP template - response | ||
The response format is identical to the REST template response. | ||
The response format is identical to the REST template response. |
149403
703