wx.cloud.callFunction({ name: 'throwtest', }).then(res => { console.log('without error:', res) }).catch(err => { console.log('error:', err) }) 如果云函数无法主动抛出错误,前端里自己的逻辑就只能在 then 里处理了
云函数如何手动抛异常- 当前 Bug 的表现(可附上截图) 云函数中抛出异常,但是小程序仍然接受到正常的返回 exports.main = async (event, context) => { throw('error') } 但是小程序调用端,仍然正常返回,result:null 。 - 预期表现 小程序端的catch中的函数被调用 - 复现路径 - 提供一个最简复现 Demo 云函数端 exports.main = async (event, context) => { throw('error') } 小程序端 wx.cloud.callFunction({ name: 'throwtest', }).then(res => { console.log('without error:', res) }).catch(err => { console.log('error:', err) })
2023-03-13请问找到原因了吗
wx.getImageInfo失败开发工具上手机预览,wx.getImageInfo失败,但手机上打开调试之后就成功了,之后这个手机获取wx.getImageInfo就成功了且关闭调试后页也成功(真机调试同样的情况)
2019-06-19请问你解决了吗?
wx.getImageInfo getImageInfo:failwx.getImageInfo({ src: 'https://wx.airppt.cn/vM8iaCCMI4iaDkt040TuKeZ0RHVQoJgqWsBibhAEmbcjUPBQd5fvkPpdA.jpg', success: function success(res) {} })
2019-06-19我也发现了,iphone有时候会获取不到值,但是android一直很稳定。我在 app.js 的onLaunch 和 onShow 里面都试过调用 getMenuButtonBoundingClientRect 方法, 获取的 bottom 和 top 都是0,其他值没进行输出,不知道是否有值
getMenuButtonBoundingClientRect偶尔获取不到值在真机和在开发工具上,经常这个值获取不到
2019-05-28