Reputation: 21575
I find it difficult to find where the error occured when using next(err)
. Is there a way how to save the stack to trace the error back to the original files? (Even if it was a validation error I would like to know the exact place from where it originated.)
Upvotes: 1
Views: 269
Reputation: 3342
You can add error.stack to your error handling.
console.log(error, error.stack)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack
Upvotes: 2