From 099cccfdb8444b3243a3e6904387210906c4ab03 Mon Sep 17 00:00:00 2001 From: zhangzezhong Date: Thu, 19 Jun 2025 14:47:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangzezhong --- frameworks/js/napi/caller/caller.js | 4 ++-- .../ability_business_error.cpp | 15 ++++++++------- .../src/ability_runtime_error_util.cpp | 6 +++--- .../src/ability_runtime_error_util.cpp | 8 ++++---- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/frameworks/js/napi/caller/caller.js b/frameworks/js/napi/caller/caller.js index 0611c1e3ddf..1b18218d1b8 100644 --- a/frameworks/js/napi/caller/caller.js +++ b/frameworks/js/napi/caller/caller.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -27,7 +27,7 @@ const ERROR_CODE_CLAAEE_INVALID = 16200002; const ERROR_CODE_INNER_ERROR = 16000050; const ERROR_MSG_INVALID_PARAM = 'Invalid input parameter.'; -const ERROR_MSG_CALLER_RELEASED = 'Caller released. The caller has been released.'; +const ERROR_MSG_CALLER_RELEASED = 'The caller has been released.'; const ERROR_MSG_CLAAEE_INVALID = 'The callee does not exist.'; const ERROR_MSG_INNER_ERROR = 'Inner Error.'; diff --git a/frameworks/native/ability/native/ability_business_error/ability_business_error.cpp b/frameworks/native/ability/native/ability_business_error/ability_business_error.cpp index 098782a6c9e..625cd119d01 100644 --- a/frameworks/native/ability/native/ability_business_error/ability_business_error.cpp +++ b/frameworks/native/ability/native/ability_business_error/ability_business_error.cpp @@ -33,13 +33,14 @@ constexpr const char* ERROR_MSG_INNER = "Internal error."; constexpr const char* ERROR_MSG_RESOLVE_ABILITY = "The specified ability does not exist."; constexpr const char* ERROR_MSG_INVALID_ABILITY_TYPE = "Incorrect ability type."; constexpr const char* ERROR_MSG_INVALID_ID = "The specified ID does not exist."; -constexpr const char* ERROR_MSG_INVISIBLE = "Failed to start the invisible ability."; +constexpr const char* ERROR_MSG_INVISIBLE = "Cannot start an invisible component."; constexpr const char* ERROR_MSG_STATIC_CFG_PERMISSION = "The specified process does not have the permission."; constexpr const char* ERROR_MSG_CROSS_USER = "Cross-user operations are not allowed."; constexpr const char* ERROR_MSG_SERVICE_BUSY = "Service busy. There are concurrent tasks. Try again later."; constexpr const char* ERROR_MSG_CROWDTEST_EXPIRED = "The crowdtesting application expires."; constexpr const char* ERROR_MSG_WUKONG_MODE = "An ability cannot be started or stopped in Wukong mode."; -constexpr const char* ERROR_MSG_CONTINUATION_FLAG = "The call with the continuation flag is forbidden."; +constexpr const char* ERROR_MSG_CONTINUATION_FLAG = + "The call with the continuation and prepare continuation flag is forbidden."; constexpr const char* ERROR_MSG_INVALID_CONTEXT = "The context does not exist."; constexpr const char* ERROR_MSG_CONTROLLED = "The application is controlled."; constexpr const char* ERROR_MSG_EDM_CONTROLLED = "The application is controlled by EDM."; @@ -54,7 +55,7 @@ constexpr const char* ERROR_MSG_FREE_INSTALL_CROSS_DEVICE = "Cross-device instal constexpr const char* ERROR_MSG_INVALID_URI_FLAG = "Invalid URI flag."; constexpr const char* ERROR_MSG_INVALID_URI_TYPE = "Invalid URI type."; constexpr const char* ERROR_MSG_GRANT_URI_PERMISSION = "A sandbox application cannot grant URI permission."; -constexpr const char* ERROR_MSG_GET_BUNDLE_INFO_FAILED = "Get target application info failed."; +constexpr const char* ERROR_MSG_GET_BUNDLE_INFO_FAILED = "Failed to obtain the target application information."; constexpr const char* ERROR_MSG_OPERATION_NOT_SUPPORTED = "Operation not supported."; constexpr const char* ERROR_MSG_CHILD_PROCESS_NUMBER_EXCEEDS_UPPER_BOUND = "The number of child processes exceeds the upper limit."; @@ -77,7 +78,7 @@ constexpr const char* ERROR_MSG_NOT_SUPPORT_CROSS_APP_START = "Redirection to a third-party application is not allowed in API version greater than 11."; constexpr const char* ERROR_MSG_CANNOT_MATCH_ANY_COMPONENT = "No matching ability is found."; constexpr const char* ERROR_MSG_TARGET_BUNDLE_NOT_EXIST = "The bundle does not exist or no patch has been applied."; -constexpr const char* ERROR_MSG_NO_MAIN_ABILITY = "The target bundle has no main ability."; +constexpr const char* ERROR_MSG_NO_MAIN_ABILITY = "The target bundle has no MainAbility."; constexpr const char* ERROR_MSG_NO_STATUS_BAR_ABILITY = "The target app has no status-bar ability."; constexpr const char* ERROR_MSG_NOT_ATTACHED_TO_STATUS_BAR = "The target app is not attached to a status bar."; constexpr const char* ERROR_MSG_NO_RESIDENT_PERMISSION = @@ -93,7 +94,7 @@ constexpr const char* ERROR_MSG_NOT_SUPPROT_BACK_TO_CALLER = constexpr const char* ERROR_MSG_EXTENSION_START_THIRD_PARTY_APP_CONTROLLED = "The extension can not start the specified third party application."; constexpr const char* ERROR_MSG_EXTENSION_START_SERVICE_CONTROLLED = "The extension can not start the service."; -constexpr const char* ERROR_MSG_FREE_INSTALL_TASK_NOT_EXIST = "The target free install task does not exist."; +constexpr const char* ERROR_MSG_FREE_INSTALL_TASK_NOT_EXIST = "The target free-installation task does not exist."; constexpr const char* ERROR_MSG_MULTI_INSTANCE_NOT_SUPPORTED = "Multi-instance is not supported."; constexpr const char* ERROR_MSG_INVALID_APP_INSTANCE_KEY = "The app instance key does not exist."; constexpr const char* ERROR_MSG_UPPER_LIMIT = "The number of app instances reaches the limit."; @@ -102,9 +103,9 @@ constexpr const char* ERROR_MSG_CREATE_NEW_INSTANCE_NOT_SUPPORT = "Creating a ne constexpr const char* ERROR_MSG_UI_ABILITY_IS_STARTING = "The UIAbility is being started."; constexpr const char* ERROR_MSG_EXTENSION_START_ABILITY_CONTROLLED = "The extension can not start the ability due to extension control."; -constexpr const char* ERROR_MSG_NOT_HOOK = "Only allow DelegatorAbility to call the method once."; +constexpr const char* ERROR_MSG_NOT_HOOK = "Only DelegatorAbility is allowed to call this API, and only once."; constexpr const char* ERROR_MSG_FROM_WINDOW = - "The interaction process between Ability and Window encountered an error."; + "An error occurred during the interaction between the ability and window."; constexpr const char* ERROR_TARGET_NOT_IN_APP_IDENTIFIER_ALLOW_LIST = "The target not in app identifier allow list."; constexpr const char* ERROR_TARGET_NOT_STARTED = "The target has not been started yet."; constexpr const char* ERROR_MSG_CALLER_NOT_ATOMIC_SERVICE = diff --git a/frameworks/simulator/ability_simulator/src/ability_runtime_error_util.cpp b/frameworks/simulator/ability_simulator/src/ability_runtime_error_util.cpp index 7f397c64d78..f54a4d74d62 100644 --- a/frameworks/simulator/ability_simulator/src/ability_runtime_error_util.cpp +++ b/frameworks/simulator/ability_simulator/src/ability_runtime_error_util.cpp @@ -40,7 +40,7 @@ const std::map ERROR_MSG_MAP = { { ERR_ABILITY_RUNTIME_EXTERNAL_NOT_ABILITY_CONTEXT, "The context is not ability context." }, { ERR_ABILITY_RUNTIME_EXTERNAL_VISIBILITY_VERIFICATION_FAILED, - "Failed to start the invisible ability." }, + "Cannot start an invisible component." }, { ERR_ABILITY_RUNTIME_EXTERNAL_CROSS_USER_OPERATION, "Cannot cross user operations." }, { ERR_ABILITY_RUNTIME_EXTERNAL_SERVICE_BUSY, @@ -82,7 +82,7 @@ const std::map ERROR_MSG_MAP = { { ERR_ABILITY_RUNTIME_EXTERNAL_EXECUTE_SHELL_COMMAND_FAILED, "Execute shell command failed." }, { ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_WANTAGENT, - "Invalid wantagent object." }, + "Invalid wantAgent object." }, { ERR_ABILITY_RUNTIME_EXTERNAL_WANTAGENT_NOT_FOUND, "The wantAgent object does not exist." }, { ERR_ABILITY_RUNTIME_EXTERNAL_WANTAGENT_CANCELED, @@ -92,7 +92,7 @@ const std::map ERROR_MSG_MAP = { { ERR_ABILITY_RUNTIME_EXTERNAL_FA_NOT_SUPPORT_OPERATION, "Ability type error. The specified ability type is wrong." }, { ERR_ABILITY_RUNTIME_EXTERNAL_CALLER_RELEASED, - "Caller released. The caller has been released." }, + "The caller has been released." }, { ERR_ABILITY_RUNTIME_EXTERNAL_CALLEE_INVALID, "The callee does not exist." }, { ERR_ABILITY_RUNTIME_EXTERNAL_RELEASE_ERROR, diff --git a/interfaces/inner_api/error_utils/src/ability_runtime_error_util.cpp b/interfaces/inner_api/error_utils/src/ability_runtime_error_util.cpp index 2b7abb3d252..df697c4b93f 100644 --- a/interfaces/inner_api/error_utils/src/ability_runtime_error_util.cpp +++ b/interfaces/inner_api/error_utils/src/ability_runtime_error_util.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 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 @@ -39,7 +39,7 @@ const std::map ERROR_MSG_MAP = { { ERR_ABILITY_RUNTIME_EXTERNAL_NO_SUCH_ID, "The specified ID does not exist." }, { ERR_ABILITY_RUNTIME_EXTERNAL_VISIBILITY_VERIFICATION_FAILED, - "Failed to start the invisible ability." }, + "Cannot start an invisible component." }, { ERR_ABILITY_RUNTIME_EXTERNAL_CROSS_USER_OPERATION, "Cannot cross user operations." }, { ERR_ABILITY_RUNTIME_EXTERNAL_SERVICE_BUSY, @@ -81,7 +81,7 @@ const std::map ERROR_MSG_MAP = { { ERR_ABILITY_RUNTIME_EXTERNAL_EXECUTE_SHELL_COMMAND_FAILED, "Execute shell command failed." }, { ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_WANTAGENT, - "Invalid wantagent object." }, + "Invalid wantAgent object." }, { ERR_ABILITY_RUNTIME_EXTERNAL_WANTAGENT_NOT_FOUND, "The wantAgent object does not exist." }, { ERR_ABILITY_RUNTIME_EXTERNAL_NOT_ABILITY_CONTEXT, @@ -91,7 +91,7 @@ const std::map ERROR_MSG_MAP = { { ERR_ABILITY_RUNTIME_EXTERNAL_FA_NOT_SUPPORT_OPERATION, "Ability type error. The specified ability type is wrong." }, { ERR_ABILITY_RUNTIME_EXTERNAL_CALLER_RELEASED, - "Caller released. The caller has been released." }, + "The caller has been released." }, { ERR_ABILITY_RUNTIME_EXTERNAL_CALLEE_INVALID, "The callee does not exist." }, { ERR_ABILITY_RUNTIME_EXTERNAL_RELEASE_ERROR, -- Gitee