axios
axios copied to clipboard
@nestjs/axios: Expose AxiosError class
Is there an existing issue that is already proposing this?
- [x] I have searched the existing issues
Is your feature request related to a problem? Please describe it
The example here shows how to capture an error:
catchError((error: AxiosError) => {
The problem is that AxiosError is not exported anywhere that is accessible.
Describe the solution you'd like
I think that AxiosError should be importable like:
import { AxiosError } from '@nestjs/axios';
Teachability, documentation, adoption, migration strategy
Currently, I think the only correct way of accessing it, is installing the axios package itself and import it from there.
What is the motivation / use case for changing the behavior?
Avoiding the need to install axios package.
Actually isAxiosError is a better alternative to use, but I would add both if possible.