diff --git a/interfaces/kits/js/src/mod_fs/properties/read_lines.cpp b/interfaces/kits/js/src/mod_fs/properties/read_lines.cpp index 059f2efd16ab2493246d70ed681a6992cefee75a..b52c1da0c37d66a91d2d6bb13b809bd7311e598d 100644 --- a/interfaces/kits/js/src/mod_fs/properties/read_lines.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/read_lines.cpp @@ -207,7 +207,7 @@ napi_value ReadLines::Sync(napi_env env, napi_callback_info info) int ret = GetFileSize(path.get(), offset); if (ret != 0) { HILOGE("Failed to get size of the file"); - NError(errno).ThrowErr(env); + NError(ret).ThrowErr(env); return nullptr; }