MENU
Handling Exceptions
RESETRUNFULL
Built-in DOM Exceptions:IndexSizeError, HierarchyRequestError, WrongDocumentError, InvalidCharacterError, NoModificationAllowedError, NotFoundError, NotSupportedError, InvalidStateError, SyntaxError, InvalidModificationError, NamespaceError, InvalidAccessError, TypeMismatchError, SecurityError, NetworkError, AbortError, URLMismatchError, QuotaExceededError, TimeoutError, InvalidNodeTypeError, DataCloneError, EncodingError, NotReadableError, UnknownError, ConstraintError, DataError, TransactionInactiveError, ReadOnlyError, VersionError, OperationError, NotAllowedError
<!DOCTYPE html><html>
<head></head><body>
<script>
try{
throw new DOMException("You failed!","My error")
} catch (e){
console.log(e);
}
throw new DOMException("You failed again!",
"My error 2")
</script></body></html>