当node-amqp没有exception

我正在尝试使用node-amqp

当在连接到兔子的部分抛出一个exception,我可以得到这个exception,但它永远重新启动连接到兔子。

看那个:

amqp = require("amqp") # Open a connection conn = amqp.createConnection( {url: "amqp://localhost"} , {reconnect: true}) conn.on "ready", -> console.log "Conn Ready" conn.queue "queueX", {ack:true}, (queue) -> console.log "Subscribed #{queue.name}" assdsd() #calling non-exiting method. No exception is thrown but the connection is restarted 

系统循环引发错误。 我知道这是因为{recconnect:true}。 但我希望能够自行处理例外情况。 任何想法?

我的脚本的输出是这样的:

 Conn Ready Subscribed queueX Conn Ready Subscribed queueX Conn Ready Subscribed queueX Conn Ready Subscribed queueX Conn Ready Subscribed queueX Conn Ready Subscribed queueX .... 

       

网上收集的解决方案 "当node-amqp没有exception"