From db53f709e8ea8da6f5a5b589b5506ff394f878b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A1=BE=E5=86=AC=E6=B4=8B?= Date: Thu, 28 Aug 2025 07:21:09 +0000 Subject: [PATCH] Fix error throw when GetFileSize fails in read_lines.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 顾冬洋 --- interfaces/kits/js/src/mod_fs/properties/read_lines.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 059f2efd1..b52c1da0c 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; } -- Gitee