!18306 merge catch_fix_0206 into master

Fix MULTI_CATCH_DEPRECATED error message

Created-by: yp9522
Commit-by: yp9522
Merged-by: openharmony_ci
Description: **IssueNo**:
https://gitcode.com/openharmony/arkcompiler_ets_frontend/issues/8743
**Description**:
Change the MULTI_CATCH_DEPRECATED error code from "warning" to "Semantic error".
**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |       PASS   |
| 成员变量进行赋值或创建需要排查并发                               |   PASS       |
| 谨慎在lambda表达式中使用引用捕获                                |    PASS      |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |     PASS     |
| map\vector\list\set等stl模板类使用时需要排查并发                |      PASS    |
| 谨慎考虑加锁范围                                               |    PASS      |
| 在IPC通信中谨慎使用同步通信方式                                 |      PASS    |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |    PASS      |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |      PASS    |
| 禁止多个独立创建的智能指针管理同一地址                           |      PASS    |
| 禁止在析构函数中抛异步任务                                      |      PASS    |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |   PASS       |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |      PASS    |
| 禁止接口返回局部变量引用                                        |     PASS     |
| 禁止在信号函数中加锁                                            |      PASS    |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |      PASS    |
| 禁止将同一个cpp编译在不同的so中                                 |     PASS     |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |     PASS     |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |    PASS      |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |  PASS        |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |      PASS    |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |     PASS     |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |    PASS      |
| readParcelable获取的对象使用前需要判空                            |    PASS      |
| 分配和释放内存的函数需要成对出现                                   |       PASS   |
| 申请内存后异常退出前需要及时进行内存释放                            |  PASS        |
| 内存申请前必须对内存大小进行合法性校验                              |     PASS     |
| 内存分配后必须判断是否成功                                         |       PASS   |
| 禁止使用realloc、alloca函数                                       |   PASS       |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |    PASS      |
| 禁止打印内存地址                                                  |     PASS     |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |       PASS   |
| 禁止对有符号整数进行位操作符运算                                    |       PASS   |
| 禁止对指针进行逻辑或位运算                                         |    PASS      |
| 循环次数如果收外部数据控制,需要检验其合法性                         |        PASS  |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |      PASS    |
| 谨慎使用不可重入函数                                               |    PASS      |
| 必须检查安全函数的返回值,并进行正确处理                             |   PASS       |
| 禁止仅通过TokenType类型判断绕过权限校验                             |   PASS       |

**TDD Result**:

**XTS Result**:

### 是否已执行L0用例
- [x] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!18306
This commit is contained in:
openharmony_ci
2026-02-09 22:21:36 +08:00
2 changed files with 40 additions and 40 deletions
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Huawei Device Co., Ltd.
* Copyright (c) 2025-2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -310,8 +310,8 @@ export default namespace abilityManager {
taskpool.execute((): void => {
try {
abilityManager.nativePreloadUIExtensionAbility(want, call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});
@@ -329,8 +329,8 @@ export default namespace abilityManager {
taskpool.execute((): void => {
try {
abilityManager.nativeClearPreloadedUIExtensionAbility(preloadId, call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});
@@ -348,8 +348,8 @@ export default namespace abilityManager {
taskpool.execute((): void => {
try {
abilityManager.nativeClearPreloadedUIExtensionAbilities(call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Huawei Device Co., Ltd.
* Copyright (c) 2025-2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -87,8 +87,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeGetBundleName(agent, call);
} catch (err: BusinessError) {
callback(err, "");
} catch (err) {
callback(err as BusinessError, "");
}
});
}
@@ -107,8 +107,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeTriggerAsync(agent, triggerInfo, context, call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});
@@ -133,8 +133,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeGetBundleName(agent, call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});
@@ -148,8 +148,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeGetUid(agent, call);
} catch (err: BusinessError) {
callback(err, -1);
} catch (err) {
callback(err as BusinessError, -1);
}
});
}
@@ -169,8 +169,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeGetUid(agent, call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});
@@ -184,8 +184,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeGetWant(agent, call);
} catch (err: BusinessError) {
callback(err, {} as Want);
} catch (err) {
callback(err as BusinessError, {} as Want);
}
});
}
@@ -205,8 +205,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeGetWant(agent, call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});
@@ -220,8 +220,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeCancel(agent, call);
} catch (err: BusinessError) {
callback(err, undefined);
} catch (err) {
callback(err as BusinessError, undefined);
}
});
}
@@ -241,8 +241,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeCancel(agent, call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});
@@ -257,8 +257,8 @@ namespace wantAgent {
let call = new AsyncCallbackWrapper<CompleteData>(callback);
try {
nativeTrigger(agent, triggerInfo, call);
} catch (err: BusinessError) {
callback(err, {info: new Object(), want: new Want(), finalCode: 0, finalData: 'undefined'} as CompleteData);
} catch (err) {
callback(err as BusinessError, {info: new Object(), want: new Want(), finalCode: 0, finalData: 'undefined'} as CompleteData);
}
}
});
@@ -275,8 +275,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeEqual(agent, otherAgent, call);
} catch (err: BusinessError) {
callback(err, false);
} catch (err) {
callback(err as BusinessError, false);
}
});
}
@@ -300,8 +300,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeEqual(agent, otherAgent, call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});
@@ -312,8 +312,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeGetWantAgent(info, call);
} catch (err: BusinessError) {
callback(err, {} as WantAgent);
} catch (err) {
callback(err as BusinessError, {} as WantAgent);
}
});
}
@@ -331,8 +331,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeGetWantAgent(info, call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});
@@ -346,8 +346,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeGetOperationType(agent, call);
} catch (err: BusinessError) {
callback(err, -1);
} catch (err) {
callback(err as BusinessError, -1);
}
});
}
@@ -367,8 +367,8 @@ namespace wantAgent {
taskpool.execute((): void => {
try {
nativeGetOperationType(agent, call);
} catch (err: BusinessError) {
reject(err);
} catch (err) {
reject(err as BusinessError);
}
});
});