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
|
---
title: URIError
slug: Web/JavaScript/Reference/Global_Objects/URIError
tags:
- Class
- JavaScript
- Object
- Reference
- URIError
browser-compat: javascript.builtins.URIError
---
<div>{{JSRef}}</div>
<p><code><strong>URIError</strong></code> 객체는 전역 URI 핸들링 함수가 잘못된 방식으로 사용되었을 때의 오류를 표현합니다.</p>
<h2 id="Constructor">생성자</h2>
<dl>
<dt>{{jsxref("Global_Objects/URIError/URIError", "URIError()")}}</dt>
<dd>새로운 <code>URIError</code> 객체를 만듭니다.</dd>
</dl>
<h2 id="Instance_properties">인스턴스 속성</h2>
<dl>
<dt>{{jsxref("Error.prototype.message", "URIError.prototype.message")}}</dt>
<dd>오류 메시지. 비록 ECMA-262에서 {{jsxref("RangeError")}}는 반드시 자체 <code>message</code> 속성을 제공해야한다고 명시했지만,
<a href="/en-US/docs/Mozilla/Projects/SpiderMonkey">SpiderMonkey</a>는 {{jsxref("Error.prototype.message")}}를 상속합니다.
</dd>
<dt>{{jsxref("Error.prototype.name", "URIError.prototype.name")}}</dt>
<dd>오류 이름. {{jsxref("Error")}}로부터 상속되었습니다.</dd>
<dt>{{jsxref("Error.prototype.fileName", "URIError.prototype.fileName")}}</dt>
<dd>오류가 발생한 파일 경로. {{jsxref("Error")}}로부터 상속되었습니다.</dd>
<dt>{{jsxref("Error.prototype.lineNumber", "URIError.prototype.lineNumber")}}</dt>
<dd>오류가 발생한 곳의 줄 위치. {{jsxref("Error")}}로부터 상속되었습니다.</dd>
<dt>{{jsxref("Error.prototype.columnNumber", "URIError.prototype.columnNumber")}}</dt>
<dd>오류가 발생한 곳의 열 위치. {{jsxref("Error")}}로부터 상속되었습니다.</dd>
<dt>{{jsxref("Error.prototype.stack", "URIError.prototype.stack")}}</dt>
<dd>스택 추적. {{jsxref("Error")}}로부터 상속되었습니다.</dd>
</dl>
<h2 id="Examples">예제</h2>
<h3 id="Catching_an_URIError">URIError 잡아내기</h3>
<pre class="brush: 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.fileName) // "Scratchpad/1"
console.log(e.lineNumber) // 2
console.log(e.columnNumber) // 2
console.log(e.stack) // "@Scratchpad/2:2:3\n"
}
</pre>
<h3 id="Creating_an_URIError">URIError 생성하기</h3>
<pre class="brush: js">try {
throw new URIError('Hello', 'someFile.js', 10)
} catch (e) {
console.log(e instanceof URIError) // true
console.log(e.message) // "Hello"
console.log(e.name) // "URIError"
console.log(e.fileName) // "someFile.js"
console.log(e.lineNumber) // 10
console.log(e.columnNumber) // 0
console.log(e.stack) // "@Scratchpad/2:2:9\n"
}
</pre>
<h2 id="Specifications">명세</h2>
{{Specifications}}
<h2 id="Browser_compatibility">브라우저 호환성</h2>
<p>{{Compat}}</p>
<h2 id="See_also">같이 보기</h2>
<ul>
<li>{{jsxref("Error")}}</li>
<li>{{jsxref("Global_Objects/decodeURI", "decodeURI()")}}</li>
<li>{{jsxref("Global_Objects/decodeURIComponent", "decodeURIComponent()")}}</li>
<li>{{jsxref("Global_Objects/encodeURI", "encodeURI()")}}</li>
<li>{{jsxref("Global_Objects/encodeURIComponent", "encodeURIComponent()")}}</li>
</ul>
|