enable v2 errors
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				BlockStorage/repertory/pipeline/head There was a failure building this commit
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	BlockStorage/repertory/pipeline/head There was a failure building this commit
				
			This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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<repertory::debug_log>( | ||||
|         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<repertory::debug_log>( | ||||
|         function_name, msg); | ||||
|   } | ||||
|  | ||||
|   void handle_trace(std::string_view function_name, | ||||
|                     std::string_view msg) const override { | ||||
|     repertory::event_system::instance().raise<repertory::debug_log>( | ||||
|         function_name, msg); | ||||
|   } | ||||
|  | ||||
|   void handle_warn(std::string_view function_name, | ||||
|                    std::string_view msg) const override { | ||||
|     repertory::event_system::instance().raise<repertory::debug_log>( | ||||
|         function_name, msg); | ||||
|   } | ||||
| }; | ||||
|  | ||||
| const auto repertory_handler{ | ||||
|   | ||||
| @@ -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<fs_directory_t> { | ||||
|   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 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user