Skip to content

Make AxiosError Generic as well #1730

@sumanla13a

Description

@sumanla13a

Summary

In index.d.ts, the AxiosResponse is a generic

export interface AxiosResponse<T = any>  {
  data: T;
  status: number;
  statusText: string;
  headers: any;
  config: AxiosRequestConfig;
  request?: any;
}

Shouldn't AxiosError also be a generic as it can have a response that is AxiosResponse?

export interface AxiosError<T> extends Error {
  config: AxiosRequestConfig;
  code?: string;
  request?: any;
  response?: AxiosResponse<T>;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions