Node.js doesn't display entire error message on uncaughtException, is it possible?
Problem
In node.js if you catch uncaughtExceptions, like so:
process.on('uncaughtException', function (error) {
console.log(error);
});
The Error message displayed doesn't contain all the information that you receive if you don't catch the error and just let the process crash. When you let the process crash it includes what line caused the error. Is there any way to get the full error message including the line that caused the error so we can log this data using uncaughtException.
Problem courtesy of: Sean Bannister
Solution
Try error.stack
process.on('uncaughtException', function (error) {
console.log(error.stack);
});
Solution courtesy of: mike
Discussion
View additional discussion.