Skip to content

fix: handle missing response headers case#303

Open
powersjcb wants to merge 2 commits intosoftonic:masterfrom
powersjcb:jpowers/handle-missing-response-headers
Open

fix: handle missing response headers case#303
powersjcb wants to merge 2 commits intosoftonic:masterfrom
powersjcb:jpowers/handle-missing-response-headers

Conversation

@powersjcb
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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