[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/URIError [Back]  [Original]

URIError - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

URIError

Baseline Widely available *

This feature is well established and works across many devices and browser versions. Its been available across browsers since 20157.

* Some parts of this feature may have varying levels of support.

URIError URI

URIError structuredClone() Worker postMessage()

URIError Error

In this article

URIError()

URIError

Error

URIError.prototype URIError

URIError.prototype.constructor

URIError URIError

URIError.prototype.name

URIError.prototype.name "URIError"

Error

URIError

js
try {
  decodeURIComponent("%");
} catch (e) {
  console.log(e instanceof URIError); // true
  console.log(e.message); // "malformed URI sequence"
  console.log(e.name); // "URIError"
  console.log(e.stack); // 
}

URIError

js
try {
  throw new URIError("");
} catch (e) {
  console.log(e instanceof URIError); // true
  console.log(e.message); // ""
  console.log(e.name); // "URIError"
  console.log(e.stack); // 
}

Specification
ECMAScript 2027 LanguageSpecification
# sec-native-error-types-used-in-this-standard-urierror


Web Proxy Viewer  |  New URL  |  Original Page