wendux / fly

:rocket: Supporting request forwarding and Promise based HTTP client for all JavaScript runtimes.
https://wendux.github.io/dist/#/language
MIT License
3.9k stars 639 forks source link

关于 400/500 错误的处理机制 #37

Closed exherb closed 6 years ago

exherb commented 6 years ago

400 错误是客户端错误,应该抛出错误,但是 response 还是应该反序列化为 json (如果 content-type 是 json 的话) 还是有必要的,因为需要传递错误信息,甚至连 500 错误都应该尝试这样做

wendux commented 6 years ago

错误处理部分有调整,请参照文档(flyio version>=0.44)

chenqq2436 commented 1 year ago

支付宝小程序 后端返回状态码400的情况下 拿不到response.data,当前flyio的版本是0.6.14