Using Typescript, how do I get just the stacktrace from the error?
For example look at this sample code:
} catch (err: any) {
console.log(err.message);
console.log(err.stackTrace);
console.log(err.stack);
console.log(err);
}
Take a look at these results from the above code:
What method or property do I use to get only the 3 lines of the stacktrace?
1) err.message: provides he error message as expected.
2) err.stackTrace: provides and object but I'm not sure exactly what.
3) err.stack: and "err" return exactly the same thing - everything.
Thank you.
