From 476febd2c7d9170180436ec86f2d3d32bc72d978 Mon Sep 17 00:00:00 2001 From: caochuan Date: Fri, 14 Apr 2023 13:16:18 +0800 Subject: [PATCH] fix: add E_COUNT error code for copy interface Signed-off-by: caochuan --- interfaces/kits/js/src/mod_fs/properties/copy_file.cpp | 4 ++-- utils/filemgmt_libn/include/n_error.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/interfaces/kits/js/src/mod_fs/properties/copy_file.cpp b/interfaces/kits/js/src/mod_fs/properties/copy_file.cpp index 6dc697584..a1c42bd54 100755 --- a/interfaces/kits/js/src/mod_fs/properties/copy_file.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/copy_file.cpp @@ -44,7 +44,7 @@ static NError IsAllPath(FileInfo& srcFile, FileInfo& destFile) UV_FS_COPYFILE_FICLONE, nullptr); if (ret < 0) { HILOGE("Failed to copy file when all parameters are paths"); - return NError(errno); + return NError(ret); } return NError(ERRNO_NOERR); } @@ -265,4 +265,4 @@ napi_value CopyFile::Async(napi_env env, napi_callback_info info) } } // namespace ModuleFileIO } // namespace FileManagement -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/utils/filemgmt_libn/include/n_error.h b/utils/filemgmt_libn/include/n_error.h index f56f661d2..aafd3529b 100644 --- a/utils/filemgmt_libn/include/n_error.h +++ b/utils/filemgmt_libn/include/n_error.h @@ -129,7 +129,8 @@ enum ErrCodeSuffixOfUserFileService { E_REMOVE, E_INIT, E_NOTIFY, - E_CONNECT + E_CONNECT, + E_COUNT }; enum ErrCodeSuffixOfDistributedFile { @@ -336,6 +337,7 @@ static inline std::unordered_map> errCodeTa { USER_FILE_SERVICE_SYS_CAP_TAG + E_NOTIFY, { USER_FILE_SERVICE_SYS_CAP_TAG + E_NOTIFY, "Fail to notify agent" } }, { USER_FILE_SERVICE_SYS_CAP_TAG + E_CONNECT, { USER_FILE_SERVICE_SYS_CAP_TAG + E_CONNECT, "Fail to connect file access extension ability" } }, + { USER_FILE_SERVICE_SYS_CAP_TAG + E_COUNT, { USER_FILE_SERVICE_SYS_CAP_TAG + E_COUNT, "Too many records" } }, { E_PERMISSION, { E_PERMISSION, "Permission verification failed" } }, { E_PERMISSION_SYS, { E_PERMISSION_SYS, "The caller is not a system application" } }, { E_PARAMS, { E_PARAMS, "The input parameter is invalid" } }, @@ -372,4 +374,4 @@ private: } // namespace FileManagement } // namespace OHOS -#endif // FILEMGMT_LIBN_N_ERROR_H \ No newline at end of file +#endif // FILEMGMT_LIBN_N_ERROR_H -- Gitee