Skip to content

fix: handle missing response headers case #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

powersjcb
Copy link

@powersjcb powersjcb commented Apr 10, 2025

resolves issue with testing libraries where error.response.headers is undefined and we cannot access the retry-after header.

@powersjcb
Copy link
Author

powersjcb commented Apr 10, 2025

This is currently manifesting with axios-mock-adapter@1.22.0 -> axios-mock-adapter@2.5.1.

I might try to get fix applied to that project too, but raising it here for now since this is a trivial change.

TypeError: Cannot read properties of undefined (reading 'retry-after')
    at retryAfter (node_modules/axios-retry/dist/cjs/index.js:67:145)
    at exponentialDelay (node_modules/axios-retry/dist/cjs/index.js:85:45)

@powersjcb
Copy link
Author

Have thoughts about which side we should resolve this on?

ctimmerm/axios-mock-adapter#408

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant