Firefox Tomorrow

web api instance property

ErrorEvent: filename property

View on MDN ↗

Available in workers

The filename read-only property of the ErrorEvent interface returns a string containing the name of the script file in which the error occurred.

Value

A string.

Examples

window.addEventListener("error", (ev) => {
  console.log(`The error occur in file: ${ev.filename}`);
});

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.