From 27afe97d7470d7c36af76bc6d126258acbf9244e Mon Sep 17 00:00:00 2001 From: Tomas Turina Date: Mon, 13 Jan 2025 18:04:41 +0000 Subject: [PATCH] fix: propagate exception in case of create table failure --- src/agent/agent_info/src/agent_info_persistance.cpp | 3 +++ src/agent/command_store/src/command_store.cpp | 1 + src/agent/multitype_queue/src/storage.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/src/agent/agent_info/src/agent_info_persistance.cpp b/src/agent/agent_info/src/agent_info_persistance.cpp index cccd342714..29bee95bae 100644 --- a/src/agent/agent_info/src/agent_info_persistance.cpp +++ b/src/agent/agent_info/src/agent_info_persistance.cpp @@ -79,6 +79,7 @@ void AgentInfoPersistance::CreateAgentInfoTable() catch (const std::exception& e) { LogError("Error creating table: {}.", e.what()); + throw; } } @@ -94,6 +95,7 @@ void AgentInfoPersistance::CreateAgentGroupTable() catch (const std::exception& e) { LogError("Error creating table: {}.", e.what()); + throw; } } @@ -115,6 +117,7 @@ void AgentInfoPersistance::InsertDefaultAgentInfo() catch (const std::exception& e) { LogError("Error inserting default agent info: {}.", e.what()); + throw; } } diff --git a/src/agent/command_store/src/command_store.cpp b/src/agent/command_store/src/command_store.cpp index cdf8c99fc1..bb4b6d9150 100644 --- a/src/agent/command_store/src/command_store.cpp +++ b/src/agent/command_store/src/command_store.cpp @@ -68,6 +68,7 @@ namespace command_store catch (std::exception& e) { LogError("CreateTable operation failed: {}.", e.what()); + throw; } } } diff --git a/src/agent/multitype_queue/src/storage.cpp b/src/agent/multitype_queue/src/storage.cpp index c52488523c..bbc81b438f 100644 --- a/src/agent/multitype_queue/src/storage.cpp +++ b/src/agent/multitype_queue/src/storage.cpp @@ -49,6 +49,7 @@ void Storage::CreateTable(const std::string& tableName) catch (const std::exception& e) { LogError("Error creating table: {}.", e.what()); + throw; } }