Javascript Amqp连接失败时如何接收异常? const amqp=require('amqp-connection-manager')) const{CONNECTION_URL}=require('./config/env') 类AmqpConnectionService{ 异步openConnection(){ this.connection=等待amqp.connect([connection\u URL]) this.channelWrapper=等待this.connection.createChannel({setup(channel){}) 等待此消息。channelWrapper.waitForConnect() }

Javascript Amqp连接失败时如何接收异常? const amqp=require('amqp-connection-manager')) const{CONNECTION_URL}=require('./config/env') 类AmqpConnectionService{ 异步openConnection(){ this.connection=等待amqp.connect([connection\u URL]) this.channelWrapper=等待this.connection.createChannel({setup(channel){}) 等待此消息。channelWrapper.waitForConnect() },javascript,amqp,Javascript,Amqp,使用此代码,当连接\u URL是错误的URL时,代码会卡在waitForConnect()上

使用此代码,当
连接\u URL
是错误的URL时,代码会卡在
waitForConnect()