Re-throwing exception in NodeJS and not losing stack trace
I’m not aware of a native method like Java’s and I’ve not found an elegant solution for wrapping errors yet. The problem with creating a new Error is you can lose metadata that was attached to the original Error that was thrown, the stack trace and type are generally the important items lost. Making modifications … Read more