如果在处理来自 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)