From c95143a38c13a53442d0fedd2ea6a2da46f1c94d Mon Sep 17 00:00:00 2001 From: igorlegalov Date: Fri, 22 Aug 2025 17:56:44 +0300 Subject: [PATCH] Remove Exception from tests Issue: https://gitee.com/open_harmony/dashboard?issue_id=ICUC86 Testing: all pre-merge tests passed Signed-off-by: igorlegalov --- .../ast/compiler/ets/throwInFinallyBlock.ets | 4 ++-- .../ast/compiler/ets/tryCatchMissingParam.ets | 2 +- .../ets/FixedArray/MultipleParserErrors.ets | 4 ++-- .../ast/parser/ets/MultipleParserErrors.ets | 4 ++-- .../ets/catch-soft-keyword-expected.txt | 10 ++++---- .../test/compiler/ets/catch-soft-keyword.ets | 2 +- .../compiler/ets/catchParamScope-expected.txt | 10 ++++---- .../test/compiler/ets/catchParamScope.ets | 2 +- .../ets/throwInCatchClause3-expected.txt | 24 +++++++++---------- .../test/compiler/ets/throwInCatchClause3.ets | 4 ++-- .../ets/throwInFinallyBlock1-expected.txt | 24 +++++++++---------- .../compiler/ets/throwInFinallyBlock1.ets | 6 ++--- .../ets/throwInTryStatement-expected.txt | 12 +++++----- .../test/compiler/ets/throwInTryStatement.ets | 2 +- .../ets/tryCatchMissingParamType-expected.txt | 12 +++++----- .../compiler/ets/tryCatchMissingParamType.ets | 2 +- .../ets/tryDefaultCatches-expected.txt | 10 ++++---- .../test/compiler/ets/tryDefaultCatches.ets | 2 +- ets2panda/test/runtime/ets/Enum3.ets | 8 +++---- ets2panda/test/runtime/ets/Enum5.ets | 8 +++---- .../ets/finallyCatchExecutedNormally.ets | 2 +- .../test/runtime/ets/finallyClauseThrow.ets | 2 +- .../test/runtime/ets/generic_exception.ets | 2 +- ets2panda/test/runtime/ets/top_level_02.ets | 6 ++--- .../test/runtime/ets/try-catch-no-param.ets | 6 ++--- ets2panda/test/runtime/ets/try-catch.ets | 14 +++++------ 26 files changed, 92 insertions(+), 92 deletions(-) diff --git a/ets2panda/test/ast/compiler/ets/throwInFinallyBlock.ets b/ets2panda/test/ast/compiler/ets/throwInFinallyBlock.ets index 2bb53db77e..d75a72da75 100644 --- a/ets2panda/test/ast/compiler/ets/throwInFinallyBlock.ets +++ b/ets2panda/test/ast/compiler/ets/throwInFinallyBlock.ets @@ -16,10 +16,10 @@ function main(): void { try { try { - throw new Exception(); + throw new Error(); } catch (e) {} finally /* @@ label */{ - throw new Exception(); + throw new Error(); } } catch (e) {} } diff --git a/ets2panda/test/ast/compiler/ets/tryCatchMissingParam.ets b/ets2panda/test/ast/compiler/ets/tryCatchMissingParam.ets index b2f1731f60..ed8c64227c 100644 --- a/ets2panda/test/ast/compiler/ets/tryCatchMissingParam.ets +++ b/ets2panda/test/ast/compiler/ets/tryCatchMissingParam.ets @@ -15,7 +15,7 @@ function main(): void { try { - throw new Exception(); + throw new Error(); } catch (/* @@ label */^) { //Do something. } diff --git a/ets2panda/test/ast/parser/ets/FixedArray/MultipleParserErrors.ets b/ets2panda/test/ast/parser/ets/FixedArray/MultipleParserErrors.ets index 93e45d5454..4b647af6a8 100644 --- a/ets2panda/test/ast/parser/ets/FixedArray/MultipleParserErrors.ets +++ b/ets2panda/test/ast/parser/ets/FixedArray/MultipleParserErrors.ets @@ -128,12 +128,12 @@ declare function addResult(): number; function main(): void { try { - throw new Exception(); + throw new Error(); } catch () { //Do something. } try { - throw new Exception(); + throw new Error(); } catch (e = 0) { //Do something. } diff --git a/ets2panda/test/ast/parser/ets/MultipleParserErrors.ets b/ets2panda/test/ast/parser/ets/MultipleParserErrors.ets index f5ca1c97b2..257ff2bd18 100644 --- a/ets2panda/test/ast/parser/ets/MultipleParserErrors.ets +++ b/ets2panda/test/ast/parser/ets/MultipleParserErrors.ets @@ -128,12 +128,12 @@ declare function addResult(): number; function main(): void { try { - throw new Exception(); + throw new Error(); } catch () { //Do something. } try { - throw new Exception(); + throw new Error(); } catch (e = 0) { //Do something. } diff --git a/ets2panda/test/compiler/ets/catch-soft-keyword-expected.txt b/ets2panda/test/compiler/ets/catch-soft-keyword-expected.txt index 399704b9aa..689d8a583f 100644 --- a/ets2panda/test/compiler/ets/catch-soft-keyword-expected.txt +++ b/ets2panda/test/compiler/ets/catch-soft-keyword-expected.txt @@ -718,7 +718,7 @@ "loc": { "start": { "line": 26, - "column": 30, + "column": 26, "program": "catch-soft-keyword.ets" }, "end": { @@ -737,7 +737,7 @@ "type": "ETSTypeReferencePart", "name": { "type": "Identifier", - "name": "Exception", + "name": "Error", "loc": { "start": { "line": 26, @@ -746,7 +746,7 @@ }, "end": { "line": 26, - "column": 28, + "column": 24, "program": "catch-soft-keyword.ets" } } @@ -759,7 +759,7 @@ }, "end": { "line": 26, - "column": 28, + "column": 24, "program": "catch-soft-keyword.ets" } } @@ -772,7 +772,7 @@ }, "end": { "line": 26, - "column": 28, + "column": 24, "program": "catch-soft-keyword.ets" } } diff --git a/ets2panda/test/compiler/ets/catch-soft-keyword.ets b/ets2panda/test/compiler/ets/catch-soft-keyword.ets index 4b9a3fce73..343d46f563 100644 --- a/ets2panda/test/compiler/ets/catch-soft-keyword.ets +++ b/ets2panda/test/compiler/ets/catch-soft-keyword.ets @@ -23,6 +23,6 @@ class cls { function foo(): void { let catch: int = 5; try { - } catch (catch: Exception) { + } catch (catch: Error) { } } diff --git a/ets2panda/test/compiler/ets/catchParamScope-expected.txt b/ets2panda/test/compiler/ets/catchParamScope-expected.txt index b1b53cb272..5ef16e9c33 100644 --- a/ets2panda/test/compiler/ets/catchParamScope-expected.txt +++ b/ets2panda/test/compiler/ets/catchParamScope-expected.txt @@ -456,7 +456,7 @@ "loc": { "start": { "line": 22, - "column": 36, + "column": 32, "program": "catchParamScope.ets" }, "end": { @@ -475,7 +475,7 @@ "type": "ETSTypeReferencePart", "name": { "type": "Identifier", - "name": "Exception", + "name": "Error", "loc": { "start": { "line": 22, @@ -484,7 +484,7 @@ }, "end": { "line": 22, - "column": 34, + "column": 30, "program": "catchParamScope.ets" } } @@ -497,7 +497,7 @@ }, "end": { "line": 22, - "column": 34, + "column": 30, "program": "catchParamScope.ets" } } @@ -510,7 +510,7 @@ }, "end": { "line": 22, - "column": 34, + "column": 30, "program": "catchParamScope.ets" } } diff --git a/ets2panda/test/compiler/ets/catchParamScope.ets b/ets2panda/test/compiler/ets/catchParamScope.ets index c5e1ac85c4..0d7fee1ee8 100644 --- a/ets2panda/test/compiler/ets/catchParamScope.ets +++ b/ets2panda/test/compiler/ets/catchParamScope.ets @@ -19,7 +19,7 @@ function reject(error: Object): void { function main(): void { let fn: () => void = (): void => { try { - } catch (error: Exception) { + } catch (error: Error) { reject(error); } } diff --git a/ets2panda/test/compiler/ets/throwInCatchClause3-expected.txt b/ets2panda/test/compiler/ets/throwInCatchClause3-expected.txt index e132c14936..597a6e41a6 100644 --- a/ets2panda/test/compiler/ets/throwInCatchClause3-expected.txt +++ b/ets2panda/test/compiler/ets/throwInCatchClause3-expected.txt @@ -211,7 +211,7 @@ "type": "ETSTypeReferencePart", "name": { "type": "Identifier", - "name": "Exception", + "name": "Error", "loc": { "start": { "line": 19, @@ -220,7 +220,7 @@ }, "end": { "line": 19, - "column": 32, + "column": 28, "program": "throwInCatchClause3.ets" } } @@ -233,7 +233,7 @@ }, "end": { "line": 19, - "column": 32, + "column": 28, "program": "throwInCatchClause3.ets" } } @@ -246,7 +246,7 @@ }, "end": { "line": 19, - "column": 32, + "column": 28, "program": "throwInCatchClause3.ets" } } @@ -260,7 +260,7 @@ }, "end": { "line": 19, - "column": 35, + "column": 31, "program": "throwInCatchClause3.ets" } } @@ -273,7 +273,7 @@ }, "end": { "line": 19, - "column": 35, + "column": 31, "program": "throwInCatchClause3.ets" } } @@ -324,7 +324,7 @@ "type": "ETSTypeReferencePart", "name": { "type": "Identifier", - "name": "Exception", + "name": "Error", "loc": { "start": { "line": 21, @@ -333,7 +333,7 @@ }, "end": { "line": 21, - "column": 33, + "column": 29, "program": "throwInCatchClause3.ets" } } @@ -346,7 +346,7 @@ }, "end": { "line": 21, - "column": 33, + "column": 29, "program": "throwInCatchClause3.ets" } } @@ -359,7 +359,7 @@ }, "end": { "line": 21, - "column": 33, + "column": 29, "program": "throwInCatchClause3.ets" } } @@ -372,7 +372,7 @@ }, "end": { "line": 21, - "column": 33, + "column": 29, "program": "throwInCatchClause3.ets" } } @@ -385,7 +385,7 @@ }, "end": { "line": 21, - "column": 34, + "column": 30, "program": "throwInCatchClause3.ets" } } diff --git a/ets2panda/test/compiler/ets/throwInCatchClause3.ets b/ets2panda/test/compiler/ets/throwInCatchClause3.ets index f674939d0a..d23ebfc9ff 100644 --- a/ets2panda/test/compiler/ets/throwInCatchClause3.ets +++ b/ets2panda/test/compiler/ets/throwInCatchClause3.ets @@ -16,9 +16,9 @@ function TestFunc(): void { try { try { - throw new Exception(); + throw new Error(); } catch (e) { - throw e as Exception; + throw e as Error; } } catch (e) { //Handle the exception. diff --git a/ets2panda/test/compiler/ets/throwInFinallyBlock1-expected.txt b/ets2panda/test/compiler/ets/throwInFinallyBlock1-expected.txt index d45cb76cfe..0c9aac234a 100644 --- a/ets2panda/test/compiler/ets/throwInFinallyBlock1-expected.txt +++ b/ets2panda/test/compiler/ets/throwInFinallyBlock1-expected.txt @@ -103,7 +103,7 @@ "type": "ETSTypeReferencePart", "name": { "type": "Identifier", - "name": "Exception", + "name": "Error", "loc": { "start": { "line": 18, @@ -112,7 +112,7 @@ }, "end": { "line": 18, - "column": 24, + "column": 20, "program": "throwInFinallyBlock1.ets" } } @@ -125,7 +125,7 @@ }, "end": { "line": 18, - "column": 24, + "column": 20, "program": "throwInFinallyBlock1.ets" } } @@ -138,7 +138,7 @@ }, "end": { "line": 18, - "column": 24, + "column": 20, "program": "throwInFinallyBlock1.ets" } } @@ -275,7 +275,7 @@ "type": "ETSTypeReferencePart", "name": { "type": "Identifier", - "name": "Exception", + "name": "Error", "loc": { "start": { "line": 24, @@ -284,7 +284,7 @@ }, "end": { "line": 24, - "column": 28, + "column": 24, "program": "throwInFinallyBlock1.ets" } } @@ -297,7 +297,7 @@ }, "end": { "line": 24, - "column": 28, + "column": 24, "program": "throwInFinallyBlock1.ets" } } @@ -310,7 +310,7 @@ }, "end": { "line": 24, - "column": 28, + "column": 24, "program": "throwInFinallyBlock1.ets" } } @@ -508,7 +508,7 @@ "type": "ETSTypeReferencePart", "name": { "type": "Identifier", - "name": "Exception", + "name": "Error", "loc": { "start": { "line": 30, @@ -517,7 +517,7 @@ }, "end": { "line": 30, - "column": 26, + "column": 22, "program": "throwInFinallyBlock1.ets" } } @@ -530,7 +530,7 @@ }, "end": { "line": 30, - "column": 26, + "column": 22, "program": "throwInFinallyBlock1.ets" } } @@ -543,7 +543,7 @@ }, "end": { "line": 30, - "column": 26, + "column": 22, "program": "throwInFinallyBlock1.ets" } } diff --git a/ets2panda/test/compiler/ets/throwInFinallyBlock1.ets b/ets2panda/test/compiler/ets/throwInFinallyBlock1.ets index 8325db3372..98907280d1 100644 --- a/ets2panda/test/compiler/ets/throwInFinallyBlock1.ets +++ b/ets2panda/test/compiler/ets/throwInFinallyBlock1.ets @@ -15,19 +15,19 @@ function main(): void { try { - throw new Exception() + throw new Error() } catch (e) { try {} catch (e) {} finally { try { - throw new Exception() + throw new Error() } catch (e) {} } } finally { try { - throw new Exception() + throw new Error() } catch (e) {} } } diff --git a/ets2panda/test/compiler/ets/throwInTryStatement-expected.txt b/ets2panda/test/compiler/ets/throwInTryStatement-expected.txt index b2958d6803..3cfcb6de9a 100644 --- a/ets2panda/test/compiler/ets/throwInTryStatement-expected.txt +++ b/ets2panda/test/compiler/ets/throwInTryStatement-expected.txt @@ -103,7 +103,7 @@ "type": "ETSTypeReferencePart", "name": { "type": "Identifier", - "name": "Exception", + "name": "Error", "loc": { "start": { "line": 18, @@ -112,7 +112,7 @@ }, "end": { "line": 18, - "column": 24, + "column": 20, "program": "throwInTryStatement.ets" } } @@ -125,7 +125,7 @@ }, "end": { "line": 18, - "column": 24, + "column": 20, "program": "throwInTryStatement.ets" } } @@ -138,7 +138,7 @@ }, "end": { "line": 18, - "column": 24, + "column": 20, "program": "throwInTryStatement.ets" } } @@ -152,7 +152,7 @@ }, "end": { "line": 18, - "column": 27, + "column": 23, "program": "throwInTryStatement.ets" } } @@ -165,7 +165,7 @@ }, "end": { "line": 18, - "column": 27, + "column": 23, "program": "throwInTryStatement.ets" } } diff --git a/ets2panda/test/compiler/ets/throwInTryStatement.ets b/ets2panda/test/compiler/ets/throwInTryStatement.ets index 584334e8c2..98a3cf9cb6 100644 --- a/ets2panda/test/compiler/ets/throwInTryStatement.ets +++ b/ets2panda/test/compiler/ets/throwInTryStatement.ets @@ -15,6 +15,6 @@ function main(): void { try { - throw new Exception(); + throw new Error(); } catch (e) {} } diff --git a/ets2panda/test/compiler/ets/tryCatchMissingParamType-expected.txt b/ets2panda/test/compiler/ets/tryCatchMissingParamType-expected.txt index ebf7255cf0..ed91e164f1 100644 --- a/ets2panda/test/compiler/ets/tryCatchMissingParamType-expected.txt +++ b/ets2panda/test/compiler/ets/tryCatchMissingParamType-expected.txt @@ -103,7 +103,7 @@ "type": "ETSTypeReferencePart", "name": { "type": "Identifier", - "name": "Exception", + "name": "Error", "loc": { "start": { "line": 18, @@ -112,7 +112,7 @@ }, "end": { "line": 18, - "column": 28, + "column": 24, "program": "tryCatchMissingParamType.ets" } } @@ -125,7 +125,7 @@ }, "end": { "line": 18, - "column": 28, + "column": 24, "program": "tryCatchMissingParamType.ets" } } @@ -138,7 +138,7 @@ }, "end": { "line": 18, - "column": 28, + "column": 24, "program": "tryCatchMissingParamType.ets" } } @@ -152,7 +152,7 @@ }, "end": { "line": 18, - "column": 31, + "column": 27, "program": "tryCatchMissingParamType.ets" } } @@ -165,7 +165,7 @@ }, "end": { "line": 18, - "column": 31, + "column": 27, "program": "tryCatchMissingParamType.ets" } } diff --git a/ets2panda/test/compiler/ets/tryCatchMissingParamType.ets b/ets2panda/test/compiler/ets/tryCatchMissingParamType.ets index 01c088b713..ebd6b0f73d 100644 --- a/ets2panda/test/compiler/ets/tryCatchMissingParamType.ets +++ b/ets2panda/test/compiler/ets/tryCatchMissingParamType.ets @@ -15,7 +15,7 @@ function main(): void { try { - throw new Exception(); + throw new Error(); } catch (e) { //Do something. } diff --git a/ets2panda/test/compiler/ets/tryDefaultCatches-expected.txt b/ets2panda/test/compiler/ets/tryDefaultCatches-expected.txt index b93c660e83..6ac688c6b1 100644 --- a/ets2panda/test/compiler/ets/tryDefaultCatches-expected.txt +++ b/ets2panda/test/compiler/ets/tryDefaultCatches-expected.txt @@ -193,7 +193,7 @@ "loc": { "start": { "line": 19, - "column": 26, + "column": 22, "program": "tryDefaultCatches.ets" }, "end": { @@ -212,7 +212,7 @@ "type": "ETSTypeReferencePart", "name": { "type": "Identifier", - "name": "Exception", + "name": "Error", "loc": { "start": { "line": 19, @@ -221,7 +221,7 @@ }, "end": { "line": 19, - "column": 24, + "column": 20, "program": "tryDefaultCatches.ets" } } @@ -234,7 +234,7 @@ }, "end": { "line": 19, - "column": 24, + "column": 20, "program": "tryDefaultCatches.ets" } } @@ -247,7 +247,7 @@ }, "end": { "line": 19, - "column": 24, + "column": 20, "program": "tryDefaultCatches.ets" } } diff --git a/ets2panda/test/compiler/ets/tryDefaultCatches.ets b/ets2panda/test/compiler/ets/tryDefaultCatches.ets index 90b180275b..accfa16406 100644 --- a/ets2panda/test/compiler/ets/tryDefaultCatches.ets +++ b/ets2panda/test/compiler/ets/tryDefaultCatches.ets @@ -16,7 +16,7 @@ function main(): void { try { throw new NullPointerError(); - } catch (e: Exception) { + } catch (e: Error) { //Do something. } catch (e) { //Do something. diff --git a/ets2panda/test/runtime/ets/Enum3.ets b/ets2panda/test/runtime/ets/Enum3.ets index 150f7e76c6..f149099713 100644 --- a/ets2panda/test/runtime/ets/Enum3.ets +++ b/ets2panda/test/runtime/ets/Enum3.ets @@ -43,9 +43,9 @@ function main(): void { try { let yellow: Color = Color.getValueOf("Yellow"); arktest.assertTrue(false) - } catch (e: Exception) { - arktest.assertTrue((e as Object).toString().startsWith("No enum constant Color.Yellow")) - } catch (e) {} + } catch (e) { + arktest.assertTrue((e as Object).toString().startsWith("Error: No enum constant Color.Yellow")) + } let one: int = 1; let green = one as Color; @@ -54,7 +54,7 @@ function main(): void { try { let x = 5 as Color; arktest.assertTrue( false) - } catch (e: Error) { + } catch (e) { arktest.assertTrue( (e as Object).toString().startsWith("Error: No enum Color with value 5")) } diff --git a/ets2panda/test/runtime/ets/Enum5.ets b/ets2panda/test/runtime/ets/Enum5.ets index c765271af6..44e5b8ea66 100644 --- a/ets2panda/test/runtime/ets/Enum5.ets +++ b/ets2panda/test/runtime/ets/Enum5.ets @@ -77,9 +77,9 @@ function main(): void { try { let yellow: Color = Color.getValueOf("Yellow"); arktest.assertTrue(false) - } catch (e: Exception) { - arktest.assertTrue((e as Object).toString().startsWith("No enum constant Color.Yellow")) - } catch (e) {} + } catch (e) { + arktest.assertTrue((e as Object).toString().startsWith("Error: No enum constant Color.Yellow")) + } ord = "red"; let green: Color = ord as Color; @@ -88,7 +88,7 @@ function main(): void { try { let x = "a" as Color; arktest.assertTrue( false) - } catch (e: Error) { + } catch (e) { arktest.assertTrue( (e as Object).toString().startsWith("Error: No enum Color with value a")) } diff --git a/ets2panda/test/runtime/ets/finallyCatchExecutedNormally.ets b/ets2panda/test/runtime/ets/finallyCatchExecutedNormally.ets index a9b85803f1..5d37cc8123 100644 --- a/ets2panda/test/runtime/ets/finallyCatchExecutedNormally.ets +++ b/ets2panda/test/runtime/ets/finallyCatchExecutedNormally.ets @@ -16,7 +16,7 @@ function main() : void { let a = 0; try { - throw new Exception(); + throw new Error(); } catch (e) { a = 2; } finally { diff --git a/ets2panda/test/runtime/ets/finallyClauseThrow.ets b/ets2panda/test/runtime/ets/finallyClauseThrow.ets index 2b9537b10a..55baa5cdc2 100644 --- a/ets2panda/test/runtime/ets/finallyClauseThrow.ets +++ b/ets2panda/test/runtime/ets/finallyClauseThrow.ets @@ -16,7 +16,7 @@ function main() : int { try { try { - throw new Exception(); + throw new Error(); } catch (e:Error) { arktest.assertTrue(false) } finally { diff --git a/ets2panda/test/runtime/ets/generic_exception.ets b/ets2panda/test/runtime/ets/generic_exception.ets index e5ef48a63f..7db4c0e4fb 100644 --- a/ets2panda/test/runtime/ets/generic_exception.ets +++ b/ets2panda/test/runtime/ets/generic_exception.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -class E extends Exception {} +class E extends Error {} function main(): int { try { diff --git a/ets2panda/test/runtime/ets/top_level_02.ets b/ets2panda/test/runtime/ets/top_level_02.ets index bbdf6f1608..a76b771d15 100644 --- a/ets2panda/test/runtime/ets/top_level_02.ets +++ b/ets2panda/test/runtime/ets/top_level_02.ets @@ -27,7 +27,7 @@ switch (q) { } } -class TestException extends Exception { +class TestError extends Error { } arktest.assertEQ(q, 3) @@ -36,9 +36,9 @@ arktest.assertEQ(s, "abc") try { s += "cba"; q += 5; - throw new TestException(); + throw new TestError(); } -catch (e: TestException) { +catch (e: TestError) { } catch (e) { arktest.assertTrue(false) diff --git a/ets2panda/test/runtime/ets/try-catch-no-param.ets b/ets2panda/test/runtime/ets/try-catch-no-param.ets index 96d6bbc534..dbcb9dbfab 100644 --- a/ets2panda/test/runtime/ets/try-catch-no-param.ets +++ b/ets2panda/test/runtime/ets/try-catch-no-param.ets @@ -13,13 +13,13 @@ * limitations under the License. */ -class TestException extends Exception {} +class TestError extends Error {} let catchCode = 0; function main(): void { try { - throw new TestException(); + throw new TestError(); } catch (e) { catchCode = 1; } @@ -27,7 +27,7 @@ function main(): void { arktest.assertEQ(catchCode, 1) try { - throw new Exception(); + throw new Error(); } catch (e) { catchCode = 2; } diff --git a/ets2panda/test/runtime/ets/try-catch.ets b/ets2panda/test/runtime/ets/try-catch.ets index 9415ba2e58..cfe155b47f 100644 --- a/ets2panda/test/runtime/ets/try-catch.ets +++ b/ets2panda/test/runtime/ets/try-catch.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -class TestException extends Exception {} +class TestError extends Error {} let catchCode = 0; @@ -43,10 +43,10 @@ function main(): void { arktest.assertEQ(catchCode, 2) try { - throw new TestException(); - } catch(e: TestException) { + throw new TestError(); + } catch(e: TestError) { catchCode = 3; - } catch (e: Exception) { + } catch (e: Error) { arktest.assertTrue(false) } catch (e) { arktest.assertTrue(false) @@ -55,10 +55,10 @@ function main(): void { arktest.assertEQ(catchCode, 3) try { - throw new TestException(); - } catch (e: Exception) { + throw new TestError(); + } catch (e: Error) { catchCode = 4; - } catch (e: TestException) { + } catch (e: TestError) { arktest.assertTrue(false) } catch (e) { arktest.assertTrue(false) -- Gitee