diff --git a/interfaces/kits/js/src/mod_fs/class_stream/stream_n_exporter.cpp b/interfaces/kits/js/src/mod_fs/class_stream/stream_n_exporter.cpp index 22b8385f8656ec7c8030c63aa82789b976ab789a..dae4d4775642df26d3a8bf87fbd38609022c7fa0 100644 --- a/interfaces/kits/js/src/mod_fs/class_stream/stream_n_exporter.cpp +++ b/interfaces/kits/js/src/mod_fs/class_stream/stream_n_exporter.cpp @@ -208,7 +208,7 @@ napi_value StreamNExporter::Write(napi_env env, napi_callback_info cbInfo) auto streamEntity = NClass::GetEntityOf(env, funcArg.GetThisVar()); if (!streamEntity || !streamEntity->fp) { - HILOGE("Failed to get entity of Stream"); + HILOGD("Failed to get entity of Stream"); NError(EIO).ThrowErr(env); return nullptr; } diff --git a/interfaces/kits/js/src/mod_fs/properties/prop_n_exporter.cpp b/interfaces/kits/js/src/mod_fs/properties/prop_n_exporter.cpp index 3d7b0ecae10493f8d6d6688900b5247962d5af22..a0e20a1ec8f53585512e816d833e23d632a9bd86 100644 --- a/interfaces/kits/js/src/mod_fs/properties/prop_n_exporter.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/prop_n_exporter.cpp @@ -263,7 +263,9 @@ napi_value PropNExporter::UnlinkSync(napi_env env, napi_callback_info info) } int ret = uv_fs_unlink(nullptr, unlink_req.get(), path.get(), nullptr); if (ret < 0) { - HILOGE("Failed to unlink with path"); + if (ret != -ENOENT) { + HILOGE("Failed to unlink with path, result:%{pubilc}d", ret); + } NError(ret).ThrowErr(env); return nullptr; } @@ -309,7 +311,9 @@ static NError MkdirExec(const string &path, bool recursion, bool hasOption) #endif int ret = MkdirCore(path); if (ret) { - HILOGE("Failed to create directory"); + if (ret != -ENOENT) { + HILOGE("Failed to create directory, result:%{pubilc}d", ret); + } return NError(ret); } return NError(ERRNO_NOERR); diff --git a/interfaces/kits/js/src/mod_fs/properties/stat.cpp b/interfaces/kits/js/src/mod_fs/properties/stat.cpp index 26e44c86e31ba521144b14de5d9280d001aa122b..7a22ac50f310d681af97f2a5dbaafa1d51e8bd59 100644 --- a/interfaces/kits/js/src/mod_fs/properties/stat.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/stat.cpp @@ -58,7 +58,9 @@ static NError CheckFsStat(const FileInfo &fileInfo, uv_fs_t* req) if (fileInfo.isPath) { int ret = uv_fs_stat(nullptr, req, fileInfo.path.get(), nullptr); if (ret < 0) { - HILOGE("Failed to stat file with path"); + if (ret != -ENOENT) { + HILOGE("Failed to stat file with path, result:%{pubilc}d", ret); + } return NError(ret); } } else {