Is it possible to throw an Error with an inner Error in TypeScript, similar to how it's done in C#?
In C#, you can achieve this by catching the exception and throwing a new one with the original exception as its inner exception:
try
{
var a = 3;
var b = 0;
var c = a/b;
}
catch(Exception ex)
{
throw new Exception("Your custom message", ex);
}
Is there a way to accomplish something similar in TypeScript? Perhaps with the help of an NPM package? I have searched for such a package but haven't been able to find one so far.