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..2f1ca10c94af0211399f73b5f37fb2a41d01230a 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 @@ -13,6 +13,7 @@ * limitations under the License. */ +#define SPECIAL_ERROR -2 #include "prop_n_exporter.h" #include @@ -263,7 +264,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 != SPECIAL_ERROR) { + HILOGE("Failed to unlink with path"); + } NError(ret).ThrowErr(env); return nullptr; } diff --git a/interfaces/kits/js/src/mod_fs/properties/stat.cpp b/interfaces/kits/js/src/mod_fs/properties/stat.cpp index 26e44c86e31ba521144b14de5d9280d001aa122b..bb52647adcd139ded34ad0571c9a2f702f694c7f 100644 --- a/interfaces/kits/js/src/mod_fs/properties/stat.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/stat.cpp @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#define SPE_ERROR -2 #include "stat.h" #include @@ -58,7 +59,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) { + if (ret != SPE_ERROR) { HILOGE("Failed to stat file with path"); + } return NError(ret); } } else {