URIError
URIError 对象表示以错误方式使用全局 URI 处理函数时出现的错误。
¥The URIError object represents an error when a global URI handling function was used in a wrong way.
URIError 是 serializable object,因此可以使用 structuredClone() 进行克隆,或者使用 postMessage() 在 工人 之间进行复制。
¥URIError is a serializable object, so it can be cloned with structuredClone() or copied between Workers using postMessage().
URIError 是 Error 的子类。
¥URIError is a subclass of Error.
构造函数
实例属性
¥Instance properties
还从其父级 Error 继承实例属性。
¥Also inherits instance properties from its parent Error.
这些属性在 URIError.prototype 上定义并由所有 URIError 实例共享。
¥These properties are defined on URIError.prototype and shared by all URIError instances.
URIError.prototype.constructor-
创建实例对象的构造函数。对于
URIError实例,初始值为URIError构造函数。 URIError.prototype.name-
表示错误类型的名称。对于
URIError.prototype.name,初始值为"URIError"。
实例方法
示例
捕获 URI 错误
创建 URI 错误
规范
| Specification |
|---|
| ECMAScript Language Specification # sec-native-error-types-used-in-this-standard-urierror |
浏览器兼容性
BCD tables only load in the browser