Comparing version 3.5.2 to 3.6.0
@@ -36,3 +36,3 @@ 'use strict'; | ||
this.type = this.type; | ||
this.stack = (new Error(raw.message)).stack; | ||
@@ -45,3 +45,3 @@ this.rawType = raw.type; | ||
this.raw = raw; | ||
this.requestId = raw.requestId; | ||
} | ||
@@ -48,0 +48,0 @@ }); |
@@ -126,2 +126,4 @@ 'use strict'; | ||
res.on('end', function() { | ||
var headers = res.headers || {}; | ||
try { | ||
@@ -131,2 +133,5 @@ response = JSON.parse(response); | ||
var err; | ||
response.error.requestId = headers['request-id']; | ||
if (res.statusCode === 401) { | ||
@@ -145,3 +150,4 @@ err = new Error.StripeAuthenticationError(response.error); | ||
response: response, | ||
exception: e | ||
exception: e, | ||
requestId: headers['request-id'] | ||
}), | ||
@@ -148,0 +154,0 @@ null |
{ | ||
"name": "stripe", | ||
"version": "3.5.2", | ||
"version": "3.6.0", | ||
"description": "Stripe API wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -23,4 +23,8 @@ 'use strict'; | ||
}); | ||
it('Pulls in request IDs', function() { | ||
var e = Error.StripeError.generate({ type: 'card_error', requestId: 'foo'}); | ||
expect(e).to.have.property('requestId', 'foo'); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
164553
4448