tree: 42c2163915130b12974cb4de25ff69acbc957922 [path history] [tgz]
  1. lib/
  2. LICENSE.txt
  3. package.json
  4. README.md
node_modules/domexception/README.md

DOMException

This package implements the DOMException class, from web browsers. It exists in service of jsdom and related packages.

Example usage:

const DOMException = require("domexception");

const e1 = new DOMException("Something went wrong", "BadThingsError");
console.assert(e1.name === "BadThingsError");
console.assert(e1.code === 0);

const e2 = new DOMException("Another exciting error message", "NoModificationAllowedError");
console.assert(e2.name === "NoModificationAllowedError");
console.assert(e2.code === 7);

console.assert(DOMException.INUSE_ATTRIBUTE_ERR === 10);