If an error is thrown inside a node.js function that handles incoming messages from RabbitMQ, the stack trace is from the node-amqp code instead of the one in my handler (and the error is commonly "cannot call method indexOf of undefined", regardless of what the actual error is).
Is there any way to get a stacktrace of my code being executed instead of one that stops at "the edge" of the node-amqp module?
Example stack trace:
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)
In the lib at the line your stack trace refers to seems to lack a name of the queue, if you give your queue a name - maybe you get better stack trace?
https://github.com/postwait/node-amqp/blob/master/lib/queue.js#L398