diff --git a/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp b/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp index 2ebcca46e717289c6bf2ef4b1de676a8e457ccab..7fd3496c98e9da5040288c45cc3eb84a0055c00d 100644 --- a/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp +++ b/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp @@ -27,7 +27,8 @@ namespace OHOS { namespace AppExecFwk { namespace { -constexpr const char* PARSE_SHORTCUT_INFO = "ParseShortCutInfo"; +constexpr const char* INVALID_SHORTCUT_INFO_ERROR = + "invalid ShortcutInfo: parameter type error, or appIndex is less than 0"; constexpr const char* NS_NAME_SHORTCUTMANAGER = "@ohos.bundle.shortcutManager.shortcutManager"; } @@ -45,7 +46,7 @@ static void AniAddDesktopShortcutInfo(ani_env* env, ani_object info, ani_double ShortcutInfo shortcutInfo; if (!CommonFunAni::ParseShortcutInfo(env, info, shortcutInfo) || !CommonFunc::CheckShortcutInfo(shortcutInfo)) { - BusinessErrorAni::ThrowError(env, ERROR_PARAM_CHECK_ERROR, PARSE_SHORTCUT_INFO); + BusinessErrorAni::ThrowError(env, ERROR_PARAM_CHECK_ERROR, INVALID_SHORTCUT_INFO_ERROR); APP_LOGE("Parse shortcutInfo err. userId:%{public}d", userId); return; } @@ -79,7 +80,7 @@ static void AniDeleteDesktopShortcutInfo(ani_env* env, ani_object info, ani_doub if (!CommonFunAni::ParseShortcutInfo(env, info, shortcutInfo) || !CommonFunc::CheckShortcutInfo(shortcutInfo)) { APP_LOGE("Parse shortcutInfo err. userId:%{public}d", userId); - BusinessErrorAni::ThrowError(env, ERROR_PARAM_CHECK_ERROR, PARSE_SHORTCUT_INFO); + BusinessErrorAni::ThrowError(env, ERROR_PARAM_CHECK_ERROR, INVALID_SHORTCUT_INFO_ERROR); return; }