aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/domerror/index.html
blob: 5d5df14e5fe35221f42d961666daecf13ae5b345 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
---
title: DOMError
slug: Web/API/DOMError
translation_of: Web/API/DOMError
---
<p>{{ APIRef("DOM") }}{{deprecated_header}}</p>

<p> <strong><code>DOMError</code></strong> 接口描述一个错误对象,该对象包含一个错误的名字。</p>

<h2 id="属性">属性</h2>

<dl>
 <dt>{{domxref("DOMError.name")}} {{readOnlyInline}}</dt>
 <dd>返回一个代表一个错误类型名称的 {{ domxref("DOMString") }} (见下文).</dd>
 <dt>{{domxref("DOMError.message")}} {{readOnlyInline}}</dt>
 <dd>返回一个代表与给定错误类型名称有关的信息或描述{{ domxref("DOMString") }}</dd>
</dl>

<h2 id="Error_类型">Error 类型</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <td>Type</td>
   <td>Description</td>
  </tr>
  <tr>
   <td><code>IndexSizeError</code></td>
   <td>The index is not in the allowed range (e.g. thrown in a {{ domxref("range") }} object).<br>
    索引不在允许的范围内</td>
  </tr>
  <tr>
   <td><code>HierarchyRequestError</code></td>
   <td>The node tree hierarchy is not correct.<br>
    节点树层次结构是不正确的。</td>
  </tr>
  <tr>
   <td><code>WrongDocumentError</code></td>
   <td>The object is in the wrong {{ domxref("document") }}.<br>
    对象是错误的</td>
  </tr>
  <tr>
   <td><code>InvalidCharacterError</code></td>
   <td>The string contains invalid characters.<br>
    字符串包含无效字符。</td>
  </tr>
  <tr>
   <td><code>NoModificationAllowedError</code></td>
   <td>The object can not be modified.<br>
    对象不能被修改。</td>
  </tr>
  <tr>
   <td><code>NotFoundError</code></td>
   <td>The object can not be found here.<br>
    对象不能在这里被找到。</td>
  </tr>
  <tr>
   <td><code>NotSupportedError</code></td>
   <td>The operation is not supported<br>
    不支持的操作</td>
  </tr>
  <tr>
   <td><code>InvalidStateError</code></td>
   <td>The object is in an invalid state.<br>
    对象是一个无效的状态。</td>
  </tr>
  <tr>
   <td><code>SyntaxError</code></td>
   <td>The string did not match the expected pattern.<br>
    字符串不匹配预期的模式</td>
  </tr>
  <tr>
   <td><code>InvalidModificationError</code></td>
   <td>The object can not be modified in this way.<br>
    对象不能以这种方式被修改</td>
  </tr>
  <tr>
   <td><code>NamespaceError</code></td>
   <td>The operation is not allowed by Namespaces in XML<br>
    操作在XML命名空间内是不被允许的</td>
  </tr>
  <tr>
   <td><code>InvalidAccessError</code></td>
   <td>The object does not support the operation or argument.<br>
    对象不支持这种操作或参数。</td>
  </tr>
  <tr>
   <td><code>TypeMismatchError</code></td>
   <td>The type of the object does not match the expected type.<br>
    对象的类型不匹配预期的类型。</td>
  </tr>
  <tr>
   <td><code>SecurityError</code></td>
   <td>The operation is insecure.<br>
    此操作是不安全的。</td>
  </tr>
  <tr>
   <td><code>NetworkError</code></td>
   <td>A network error occurred.<br>
    发生网络错误</td>
  </tr>
  <tr>
   <td><code>AbortError</code></td>
   <td>The operation was aborted.<br>
    操作被中止</td>
  </tr>
  <tr>
   <td><code>URLMismatchError</code></td>
   <td>The given URL does not match another URL.<br>
    给定的URL不匹配另一个URL。</td>
  </tr>
  <tr>
   <td><code>QuotaExceededError</code></td>
   <td>The quota has been exceeded.<br>
    已经超过给定配额。</td>
  </tr>
  <tr>
   <td><code>TimeoutError</code></td>
   <td>The operation timed out.<br>
    操作超时。</td>
  </tr>
  <tr>
   <td><code>InvalidNodeTypeError</code></td>
   <td>The node is incorrect or has an incorrect ancestor for this operation.<br>
    这个操作的 节点或节点祖先 是不正确的</td>
  </tr>
  <tr>
   <td><code>DataCloneError</code></td>
   <td>The object can not be cloned.<br>
    对象不能克隆。</td>
  </tr>
 </tbody>
</table>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('DOM4', '#interface-domerror', 'DOMError')}}</td>
   <td>{{Spec2('DOM4')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Edge</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>12.0<sup>[1]</sup></td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Edge</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>12.0<sup>[1]</sup></td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] 这在Firefox version 58被删除.</p>

<h2 id="另请参阅">另请参阅</h2>

<ul>
 <li>{{ domxref("DOMException") }}</li>
</ul>