From 0771df0a44efcd1f0ebe5ec2ef38be309d2d89b4 Mon Sep 17 00:00:00 2001 From: wufarong Date: Tue, 20 May 2025 11:53:12 +0800 Subject: [PATCH] =?UTF-8?q?framework=E5=B1=82=E9=94=99=E8=AF=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=BB=86=E5=8C=96=E9=81=97=E6=BC=8F=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wufarong Change-Id: I41c92693d769635cff51a5b5224813d14adefe7c --- frameworks/js/napi/src/common_convert_content.cpp | 4 ++++ services/ans/src/permission_filter.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frameworks/js/napi/src/common_convert_content.cpp b/frameworks/js/napi/src/common_convert_content.cpp index fed18c519..e77e49c6f 100644 --- a/frameworks/js/napi/src/common_convert_content.cpp +++ b/frameworks/js/napi/src/common_convert_content.cpp @@ -573,6 +573,8 @@ napi_value Common::GetNotificationBasicContentDetailed( NAPI_CALL(env, napi_get_value_string_utf8(env, value, shortStr, SHORT_TEXT_SIZE - 1, &strLen)); if (std::strlen(shortStr) == 0) { ANS_LOGE("Property title is empty"); + std::string msg = "Incorrect parameter. Property title is empty."; + Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); return nullptr; } basicContent->SetTitle(shortStr); @@ -589,6 +591,8 @@ napi_value Common::GetNotificationBasicContentDetailed( NAPI_CALL(env, napi_get_value_string_utf8(env, value, commonStr, COMMON_TEXT_SIZE - 1, &strLen)); if (std::strlen(commonStr) == 0) { ANS_LOGE("Property text is empty"); + std::string msg = "Incorrect parameter. Property text is empty"; + Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); return nullptr; } basicContent->SetText(commonStr); diff --git a/services/ans/src/permission_filter.cpp b/services/ans/src/permission_filter.cpp index 00207a553..9726c3193 100644 --- a/services/ans/src/permission_filter.cpp +++ b/services/ans/src/permission_filter.cpp @@ -69,7 +69,7 @@ ErrCode PermissionFilter::OnPublish(const std::shared_ptr &r if (result == ERR_ANS_PREFERENCES_NOTIFICATION_SLOT_TYPE_NOT_EXIST) { message.ErrorCode(ERR_ANS_PREFERENCES_NOTIFICATION_SLOT_TYPE_NOT_EXIST).Message("Slot type not exist."); NotificationAnalyticsUtil::ReportPublishFailedEvent(record->request, message); - ANS_LOGE("Slot type not exist."); + ANS_LOGE("Slot type %{public}d not exist.", slotType); } } -- Gitee