Skip to content

fix axios errors so failed http responses use catch#1

Open
mooncitydev wants to merge 1 commit into
NerveNetwork:masterfrom
mooncitydev:fix-axios-response-reject
Open

fix axios errors so failed http responses use catch#1
mooncitydev wants to merge 1 commit into
NerveNetwork:masterfrom
mooncitydev:fix-axios-response-reject

Conversation

@mooncitydev
Copy link
Copy Markdown

what was wrong

the axios response interceptor used error => error in the error callback. returning a value from that handler resolves the promise with the error object, so failed requests no longer reject. callers using .catch() or try/catch around await would not run their error paths, and code could mis-handle failures.

change

use Promise.reject(error) so axios failures stay rejected and existing error handling works as intended.


made by mooncitydev

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