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

没有正确导出ResponseError #25

Closed
xiaohuoni opened this issue Feb 26, 2019 · 2 comments · Fixed by #26
Closed

没有正确导出ResponseError #25

xiaohuoni opened this issue Feb 26, 2019 · 2 comments · Fixed by #26

Comments

@xiaohuoni
Copy link
Member

在typescript中使用。

errorHandler: (error) => {
    // 集中处理请求错误
    const { response = {} } = error; ------->error:类型“Error”上不存在属性“response”
    const { status } = response;
    console.warn('error', error);
    let errorMessage = '请求错误,请重试!';
    switch (status) {
      case 500:
        errorMessage = '服务器异常';
        break;
      default:
        break;
  },
@clock157
Copy link
Contributor

1.0.4 已发布

@xiaohuoni
Copy link
Member Author

没有正确导出ResponseError ,
在需要对error声明的时候,没找到ResponseError。
npm上面的包,也少文件。
image

@xiaohuoni xiaohuoni reopened this Apr 2, 2019
@xiaohuoni xiaohuoni changed the title 类型“Error”上不存在属性“response”。 没有正确导出ResponseError Apr 2, 2019
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 a pull request may close this issue.

2 participants