diff options
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/urierror/index.html')
-rw-r--r-- | files/ko/web/javascript/reference/global_objects/urierror/index.html | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/urierror/index.html b/files/ko/web/javascript/reference/global_objects/urierror/index.html new file mode 100644 index 0000000000..91f721c511 --- /dev/null +++ b/files/ko/web/javascript/reference/global_objects/urierror/index.html @@ -0,0 +1,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> |