From cc28b31f501b06acb38aedcd4e3f5029ec838699 Mon Sep 17 00:00:00 2001 From: 3indblown Leaf <69508345+kraccoon-dev@users.noreply.github.com> Date: Wed, 2 Feb 2022 00:37:06 +0900 Subject: remove class 2 (#3923) --- .../reference/statements/try...catch/index.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'files/ko/web/javascript/reference/statements/try...catch/index.html') diff --git a/files/ko/web/javascript/reference/statements/try...catch/index.html b/files/ko/web/javascript/reference/statements/try...catch/index.html index a96c81e1a5..889fa2e7bb 100644 --- a/files/ko/web/javascript/reference/statements/try...catch/index.html +++ b/files/ko/web/javascript/reference/statements/try...catch/index.html @@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Statements/try...catch

문법

-
try {
+
try {
   try_statements
 }
 [catch (exception_var) {
@@ -67,7 +67,7 @@ translation_of: Web/JavaScript/Reference/Statements/try...catch
 
 
 
-
try {
+
try {
    throw "myException"; // generates an exception
 }
 catch (e) {
@@ -82,7 +82,7 @@ catch (e) {
 
 
 
-
try {
+
try {
   myroutine(); // may throw three types of exceptions
 } catch (e) {
   if (e instanceof TypeError) {
@@ -102,7 +102,7 @@ catch (e) {
 
 

이에 대한 일반적인 사용 사례는 예상 오류의 작은 하위 집합 만 포착 (및 침묵) 한 다음 다른 경우에 오류를 다시 발생시키는 것입니다.

-
try {
+
try {
   myRoutine();
 } catch (e) {
   if (e instanceof RangeError) {
@@ -118,7 +118,7 @@ catch (e) {
 
 
 
-
function isValidJSON(text) {
+
function isValidJSON(text) {
   try {
     JSON.parse(text);
     return true;
@@ -135,7 +135,7 @@ catch (e) {
 
 

The following example shows one use case for the finally-block. The code opens a file and then executes statements that use the file; the finally-block makes sure the file always closes after it is used even if an exception was thrown.

-
openMyFile();
+
openMyFile();
 try {
   // tie up a resource
   writeMyFile(theData);
@@ -150,7 +150,7 @@ finally {
 
 

First, let's see what happens with this:

-
try {
+
try {
   try {
     throw new Error('oops');
   }
@@ -169,7 +169,7 @@ catch (ex) {
 
 

Now, if we already caught the exception in the inner try-block by adding a catch-block

-
try {
+
try {
   try {
     throw new Error('oops');
   }
@@ -191,7 +191,7 @@ catch (ex) {
 
 

And now, let's rethrow the error.

-
try {
+
try {
   try {
     throw new Error('oops');
   }
@@ -219,7 +219,7 @@ catch (ex) {
 
 

If the finally-block returns a value, this value becomes the return value of the entire try-catch-finally statement, regardless of any return statements in the try and catch-blocks. This includes exceptions thrown inside of the catch-block:

-
(function() {
+
(function() {
   try {
     try {
       throw new Error('oops');
-- 
cgit v1.2.3-54-g00ecf