Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript log error without traceback

try {
  // code that throws error
  throw new Error("The message");
} catch (error) {
  // this will log just the error's message
  console.error(error.message);
}

// output: "The message"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #log #error #traceback
ADD COMMENT
Topic
Name
9+4 =