0

I'm trying to understand how I can get the raw object of the error in the try/catch block like so:

try {
  
} catch (error) {
  console.log(error);
}

The above is logging the stack instead of the raw object.

I'm asking this out of curiosity, because at first, I tried to print the message and not the stack and only by searching the web I could find this object has property of message.

1 Answers1

0

There is error.stack which show the stack of error in string

Simon G
  • 16
  • 1
  • 3