diff --git a/config.sh b/config.sh index afc9109c..629020af 100755 --- a/config.sh +++ b/config.sh @@ -21,6 +21,7 @@ PROJECT_PUBLIC_KEY=${DEVELOPER_PUBLIC_KEY} PROJECT_FLUTTER_BASE_HREF="/ui/" +PROJECT_ENABLE_V2_ERRORS=ON PROJECT_ENABLE_WIN32_LONG_PATH_NAMES=OFF PROJECT_ENABLE_BACKWARD_CPP=OFF diff --git a/repertory/librepertory/src/utils/error_utils.cpp b/repertory/librepertory/src/utils/error_utils.cpp index 205c0413..c504077b 100644 --- a/repertory/librepertory/src/utils/error_utils.cpp +++ b/repertory/librepertory/src/utils/error_utils.cpp @@ -22,6 +22,7 @@ #include "utils/error_utils.hpp" #include "events/event_system.hpp" +#include "events/types/debug_log.hpp" #include "events/types/repertory_exception.hpp" #include "types/repertory.hpp" #include "utils/error.hpp" @@ -29,6 +30,12 @@ namespace { struct repertory_exception_handler final : repertory::utils::error::i_exception_handler { + void handle_debug(std::string_view function_name, + std::string_view msg) const override { + repertory::event_system::instance().raise( + function_name, msg); + } + void handle_error(std::string_view function_name, std::string_view msg) const override { repertory::utils::error::raise_error(function_name, msg); @@ -42,6 +49,24 @@ struct repertory_exception_handler final const std::exception &ex) const override { repertory::utils::error::raise_error(function_name, ex); } + + void handle_info(std::string_view function_name, + std::string_view msg) const override { + repertory::event_system::instance().raise( + function_name, msg); + } + + void handle_trace(std::string_view function_name, + std::string_view msg) const override { + repertory::event_system::instance().raise( + function_name, msg); + } + + void handle_warn(std::string_view function_name, + std::string_view msg) const override { + repertory::event_system::instance().raise( + function_name, msg); + } }; const auto repertory_handler{ diff --git a/support/src/utils/file_directory.cpp b/support/src/utils/file_directory.cpp index 86342ec8..bbbd08d2 100644 --- a/support/src/utils/file_directory.cpp +++ b/support/src/utils/file_directory.cpp @@ -86,11 +86,15 @@ auto traverse_directory( struct dirent *de{nullptr}; while (res && (de = readdir(root)) && !is_stop_requested()) { if (de->d_type == DT_DIR) { - if ((std::string_view(de->d_name) != ".") && - (std::string_view(de->d_name) != "..")) { - res = directory_action(repertory::utils::file::directory( - repertory::utils::path::combine(path, {de->d_name}))); + utils::error::handle_debug(function_name, + fmt::format("item|{}", de->d_name)); + if ((std::string(de->d_name) == ".") || + (std::string(de->d_name) == "..")) { + continue; } + + res = directory_action(repertory::utils::file::directory( + repertory::utils::path::combine(path, {de->d_name}))); } else { res = file_action(repertory::utils::file::file( repertory::utils::path::combine(path, {de->d_name}))); @@ -105,8 +109,8 @@ auto traverse_directory( } // namespace namespace repertory::utils::file { -auto directory::copy_to(std::string_view new_path, - bool overwrite) const -> bool { +auto directory::copy_to(std::string_view new_path, bool overwrite) const + -> bool { REPERTORY_USES_FUNCTION_NAME(); try { @@ -213,7 +217,7 @@ auto directory::exists() const -> bool { #if defined(_WIN32) return ::PathIsDirectoryA(path_.c_str()) != 0; #else // !defined(_WIN32) - struct stat64 st {}; + struct stat64 st{}; return (stat64(path_.c_str(), &st) == 0 && S_ISDIR(st.st_mode)); #endif // defined(_WIN32) @@ -266,8 +270,8 @@ auto directory::get_directories() const -> std::vector { return {}; } -auto directory::create_file(std::string_view file_name, - bool read_only) const -> fs_file_t { +auto directory::create_file(std::string_view file_name, bool read_only) const + -> fs_file_t { REPERTORY_USES_FUNCTION_NAME(); try {