当在侦听器函数中抛出错误时,Socket.io客户端重新连接(不显示错误!)

时间:2014-07-22 09:31:24

标签: socket.io-1.0 engine.io

当我在侦听器函数中抛出错误时;

socket = require('socket.io-client').connect 'http://localhost:8080'

socket.on 'an-event', ->
    throw new Error 'An error has occured'  # this is never shown!
    console.log 'hello?'                    # this is never logged!
    process.exit 1                          # this is never called!

套接字重新连接,并且永远不会显示错误。相反,engine.io Tranport类会抛出“解析器解码错误”。

这样我就无法在侦听器函数中开发/调试逻辑。有解决方案/解决方法吗?

0 个答案:

没有答案