Skip to content

ErrorEvent: message property ​

The message property is a short text summary of the error, generated by the engine.

Value ​

A string.

  • Read-only. Assigning to it throws TypeError.
  • To get the original thrown value, read error.

Examples ​

js
application.addEventListener('error', (e) => {
  console.log(e.message);
  e.preventDefault();
});
throw new Error('Broken');

Result: prints the summary of the error, which contains Broken.

See also ​