javascript log error without traceback

Solutions on MaxInterview for javascript log error without traceback by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "javascript log error without traceback"
Amaris
30 Aug 2017
1try {
2  // code that throws error
3  throw new Error("The message");
4} catch (error) {
5  // this will log just the error's message
6  console.error(error.message);
7}
8
9// output: "The message"