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

http401错误不进入catch分支 #437

Closed
ghost opened this issue Aug 8, 2018 · 6 comments
Closed

http401错误不进入catch分支 #437

ghost opened this issue Aug 8, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Aug 8, 2018

问题描述
访问一个接口,接口返回401错误,这时候Taro.request的catch并没有触发,而是进入了正常的then流程。
wx20180808-201819 2x
wx20180808-201855
wx20180808-201842

期望行为

401错误应该进入catch分支

报错信息

[这里请贴上你的完整报错截图或文字]

系统信息

  • 操作系统:macos
  • Taro 版本1.0.0beta.2
  • Node.js 版本 10.6.0
@ghost ghost closed this as completed Aug 8, 2018
@zacksleo
Copy link
Contributor

zacksleo commented Aug 8, 2018

image

@kennylbj
Copy link

404也不进入呀,这样的设计很不合理。

@zacksleo
Copy link
Contributor

有啥不合理的,400以上代码是一大类

@kennylbj
Copy link

自己封装一个request吧,把code不是200多的请求都throw error

@DrakeXiang
Copy link

@zacksleo 支付宝下401是走的catch,太坑了

@kennylbj
Copy link

kennylbj commented Jan 6, 2020

反人类设计

This issue was closed.
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

No branches or pull requests

3 participants