Skip to content
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

fix: export AxiosError at top-level #5066

Closed
wants to merge 3 commits into from

Conversation

haneenmahd
Copy link

Fixed from exporting AxiosError as both type and value. Renamed AxiosError class type to be AxiosErrorType instead.
This was made so that there less conflicts when using a value and type together. This fixes and makes a way correct way of using AxiosError.

Refs: #5062

Fixed from exporting AxiosError as both type and value. Renamed AxiosError class type to be AxiosErrorType instead.

BREAKING CHANGE: AxiosError type is now AxiosErrorType to prevent from confliciting value and type
common: AxiosHeaders;
}

type AxiosHeaderMatcher = (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean;
type AxiosHeaderMatcher = (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the linter seems to conflict with what is native to this project

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, so how can I fix it?

@haneenmahd haneenmahd marked this pull request as draft October 9, 2022 02:07
@haneenmahd haneenmahd changed the title fix: prevent AxiosError type and AxiosError class from conflicting fix: export AxiosError at top-level Oct 9, 2022
Currently, there is no way to use AxiosError correctly. This was caused only by exporting the type at the top-level but the implementation deep inside the axios instance.
Exported the AxiosError class at the top-level to fix inconsistencies.

Refs: axios#5062

BREAKING CHANGE: AxiosError should be used from the top-level import rather than using it from the axios instance.
@haneenmahd haneenmahd marked this pull request as ready for review October 9, 2022 05:53
@jasonsaayman
Copy link
Member

I believe this has been solved, please open a new PR if not and add me to review

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.

None yet

3 participants