request请求接口偶现request index out of error?
发布于 6 年前 作者 xia75 6122 次浏览 来自 官方Issues

API:wx.request(Object object)

微信版本:7.0.6

基础库:未设置

问题:request请求接口偶现request:fail request index out of error

一个request请求放在 onShow()方法中,业务中包括将页面的PDF文件打开预览文件,预览完成后返回页面触发onshow()方法,有时候请求成功有时候请求失败,以下截图为真机模仿,9次请求5次错误,4次正常;而且现在线上我也测试了,偶现request:fail request index out of error无法请求正确的数据,请问该如何解决

3 回复

可以提供代码片段我们这边看看么?

我们的接口也出现了一样的问题,重现的几率非常大,这个没法提供代码片段。

真机调试,network 不显示请求的url,没法提供request及response详细信息。我这里提供request body的东西,有点多。目前测试的机型 novas, MLA-AL10, redMi, Meta20X均会出现这种情况,基础库2.6.6微信版本基本7.0.6↑系统版本只有一台Android6, 其他都是Android9。这里我就想问下:request:fail request index out of error 这个errorMsg 是什么状况下会出现?为什么官方没给类似这样的常见错误码,错误提示列表哇 ?https://developers.weixin.qq.com/community/develop/doc/0000a63354c9e803eac71271851800?highLine=request%3Afail%20socket%20time%20out%20timeout%3A60000------------------------------------------------------------------------------------------------------{“percent_correct”:“50”,“mean_reaction_time”:“0.145”,“image_order”:“1,2,3,1,4,2,5,6,7,3,8,4,9,5,10,6,11,12,13,7,8,14,9,15,10,1,2,16,3,4,5,11,17,18,12,13,19,20,21,14,22,15,23,16,24,17,18,25,19,20”,“unique_image_total”:25,“incorrect_total”:25,“image_total”:25,“seen_image_total”:50,“clicked_false_reaction_times”:“433,134,131,126,127,135,126,130,135,137,136,144,157,145,126,138,146,135,137,144,156,138,144,145,137”,“clicked_true_reaction_times”:“118,128,138,144,130,143,136,130,124,145,144,136,153,136,136,121,112,160,149,145,138,151,138,177,185”,“clicked_false_image_indexs”:“0,1,2,4,6,7,8,10,12,14,16,17,18,21,23,27,32,33,36,37,38,40,42,44,47”,“clicked_true_image_indexs”:“3,5,9,11,13,15,19,20,22,24,25,26,28,29,30,31,34,35,39,41,43,45,46,48,49”,“seen_not_clicked_image_indexs”:"",“all_reaction_times”:“433,134,131,118,126,128,127,135,126,138,130,144,135,130,137,143,136,144,157,136,130,145,124,126,145,144,136,138,153,136,136,121,146,135,112,160,137,144,156,149,138,145,144,138,145,151,138,137,177,185”,“seen_image_indexs”:“1,2,3,1,4,2,5,6,7,3,8,4,9,5,10,6,11,12,13,7,8,14,9,15,10,1,2,16,3,4,5,11,17,18,12,13,19,20,21,14,22,15,23,16,24,17,18,25,19,20”,“start_test_time”:“2019-10-29 12:54:03”,“end_test_time”:“2019-10-29 12:54:04”,“image_data”:"[{\“url\”:\“https://flash.memtrax.com.cn/cookies93.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/cookies24.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/belt6.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/tree207.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/wonder358.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/belt52.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/cookies104.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/wonder281.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/tree205.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/wonder332.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/tree209.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/cookies168.jpeg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/tool231.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/belt97.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/tree400.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/belt65.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/tool144.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/cookies74.jpeg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/belt59.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/tool71.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/tree389.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/wonder417.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/wonder392.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/tool23.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”},{\“url\”:\“https://flash.memtrax.com.cn/tool135.jpg?x-oss-process=image/resize,m_fill,h_480,w_640\”}]",“device_type”:“iOS 10.0.1”,“uid”:18593}

请问怎么处理的这个问题,麻烦告知一下,多谢了,微信YX5592259,有偿解决

回到顶部