首页 文章

如何从RabbitMQ订阅处理程序中的错误中获取我自己的代码中的堆栈跟踪?

提问于
浏览
0

如果在处理来自RabbitMQ的传入消息的node.js函数中抛出错误,则堆栈跟踪来自node-amqp代码而不是我的处理程序中的错误(并且错误通常是“无法调用未定义的方法indexOf”,不管实际的错误是什么) .

有没有办法让我的代码执行堆栈跟踪而不是在node-amqp模块的“边缘”停止的代码?

堆栈跟踪示例:

stackTrace=TypeError: Cannot call method 'indexOf' of undefined
at Queue._onMethod (/myproject/node_modules/besedoq/node_modules/amqp/lib/queue.js:398:23)
at Queue.Channel._onChannelMethod (/myproject/node_modules/besedoq/node_modules/amqp/lib/channel.js:85:12)
at Connection._onMethod (/myproject/node_modules/besedoq/node_modules/amqp/lib/connection.js:443:28)
at AMQPParser.self.parser.onMethod (/myproject/node_modules/besedoq/node_modules/amqp/lib/connection.js:136:12)

1 回答

相关问题