Is there a preferred way to include inner exceptions when throwing exceptions in JavaScript?
I'm relatively new to JavaScript coming from a C# background. In C#, you can do the following:
try
{
// Do stuff
}
catch (Exception ex)
{
throw new Exception("This is a more detailed message.", ex);
}
In the samples I've seen in JavaScript, I haven't been able to find how to catch an exception, add a new message, and re-throw the new exception while still passing the original exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With