For now (until there’s a better answer), this is what I’ve done:
...
} catch(e) {
throw new Error("My error message, caused by: "+e.stack+"\n ------The above causes:-----")
}
The way I’m printing exceptions makes it nice and clean looking:
console.log(e.stack)
prints something like this:
My error message: SomeError
<some line>
<more lines>
------The above causes:-----
<some line>
<more lines>
The line might be better if it said “causes” because the stack trace of the exception causing the error is printed first.