FG
๐Ÿ”Œ APIs & SDKsStripe

Include lastResponse in error object

Freshalmost 9 years ago
Mar 14, 20260 views
Confidence Score85%
85%

Problem

Hi If a stripe error occurs (e.g. StripeCardError), it would be useful to be able to access the headers within the error object - particularly the date header. Would it be possible for the error object to include either lastResponse or lastReponse.headers please? Thanks very much. Robin

Error Output

error occurs (e.g. StripeCardError), it would be useful to be able to access the headers within the error object - particularly the date header.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: Include lastResponse in error object

Low Risk

Hi @rcwwilliams, I think you should be able to get these already with `lastResponse.headers`. See an example in the test suites here.

84

Trust Score

1 verification

100% success
  1. 1

    Hi @rcwwilliams, I think you should be able to get these already with `lastRespo

    Hi @rcwwilliams, I think you should be able to get these already with `lastResponse.headers`. See an example in the test suites here.

Validation

Resolved in stripe/stripe-node GitHub issue #335. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

stripepaymentsapi