Shimmers688
Shimmers688
我也遇到了相同的问题 
@robertsLando Thanks a lot. For H5 Page, with client.stream.on('error'), I can catch the error. But in Wechat MiniProgram, it still don't work. 
ok, thank you again for your helpful reply!
Including stream.emit('error') within the socketTask.onError() listener, then I can catch the error with client.stream.on('error')." ```js https://github.com/mqttjs/MQTT.js/blob/c8b6695eec6b541b83f4090ba2cdbbad4ae8f712/src/lib/connect/wx.ts#L85 socketTask.onError((error) => { stream.emit('error', new Error('wx.connectSocket: ' + res.errMsg)) // add this line const...