From 35d6c86c763ce0021010b6c048aedc952ae91f04 Mon Sep 17 00:00:00 2001 From: Jorge Ferreira Date: Wed, 8 Apr 2026 19:52:24 +0000 Subject: [PATCH 1/3] Fix 3dblox parser error Signed-off-by: Jorge Ferreira --- src/odb/src/3dblox/baseParser.cpp | 6 +++++- src/odb/src/3dblox/dbvParser.cpp | 2 +- src/odb/src/3dblox/dbxParser.cpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/odb/src/3dblox/baseParser.cpp b/src/odb/src/3dblox/baseParser.cpp index e21d8f2bf76..78ffa2da8a1 100644 --- a/src/odb/src/3dblox/baseParser.cpp +++ b/src/odb/src/3dblox/baseParser.cpp @@ -174,7 +174,11 @@ void BaseParser::resolvePaths(const std::string& path, void BaseParser::logError(const std::string& message) { - logger_->error(utl::ODB, 521, "Parser Error: {}", message); + std::string msg = message; + if (!current_file_path_.empty()) { + msg = "in " + current_file_path_ + ": " + message; + } + logger_->error(utl::ODB, 521, "Parser Error: {} ", msg); } std::string BaseParser::trim(const std::string& str) diff --git a/src/odb/src/3dblox/dbvParser.cpp b/src/odb/src/3dblox/dbvParser.cpp index ddeff4c4b87..495978d238e 100644 --- a/src/odb/src/3dblox/dbvParser.cpp +++ b/src/odb/src/3dblox/dbvParser.cpp @@ -27,7 +27,7 @@ DbvData DbvParser::parseFile(const std::string& filename) current_file_path_ = filename; std::ifstream file(filename); if (!file.is_open()) { - logError("3DBV Parser Error: Cannot open file: " + filename); + logError("3DBV Parser Error: Cannot open file"); } std::stringstream buffer; diff --git a/src/odb/src/3dblox/dbxParser.cpp b/src/odb/src/3dblox/dbxParser.cpp index 39d8304fc50..9bc4feffa4c 100644 --- a/src/odb/src/3dblox/dbxParser.cpp +++ b/src/odb/src/3dblox/dbxParser.cpp @@ -26,7 +26,7 @@ DbxData DbxParser::parseFile(const std::string& filename) current_file_path_ = filename; std::ifstream file(filename); if (!file.is_open()) { - logError("DBX Parser Error: Cannot open file: " + filename); + logError("DBX Parser Error: Cannot open file"); } std::stringstream buffer; From 6a11751c8adf4bbd091ecd05021c52c40b693171 Mon Sep 17 00:00:00 2001 From: Jorge Ferreira Date: Wed, 8 Apr 2026 20:32:58 +0000 Subject: [PATCH 2/3] fix: redundant error message in 3dblox parsers Signed-off-by: Jorge Ferreira --- src/odb/src/3dblox/baseParser.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/odb/src/3dblox/baseParser.cpp b/src/odb/src/3dblox/baseParser.cpp index 78ffa2da8a1..0c676133937 100644 --- a/src/odb/src/3dblox/baseParser.cpp +++ b/src/odb/src/3dblox/baseParser.cpp @@ -174,11 +174,12 @@ void BaseParser::resolvePaths(const std::string& path, void BaseParser::logError(const std::string& message) { - std::string msg = message; if (!current_file_path_.empty()) { - msg = "in " + current_file_path_ + ": " + message; + logger_->error( + utl::ODB, 521, "Parser Error in {}: {}", current_file_path_, message); + } else { + logger_->error(utl::ODB, 521, "Parser Error: {}", message); } - logger_->error(utl::ODB, 521, "Parser Error: {} ", msg); } std::string BaseParser::trim(const std::string& str) From ef69bbb54701783058167a8fa35c281e062ea6e5 Mon Sep 17 00:00:00 2001 From: Jorge Ferreira Date: Thu, 9 Apr 2026 15:10:42 +0000 Subject: [PATCH 3/3] fix: address PR review comments on 3dblox parsers Remove unreachable else branch in BaseParser::logError and simplify error messages in DbvParser and DbxParser by removing redundant prefixes already included by logError. Signed-off-by: Jorge Ferreira --- src/odb/src/3dblox/baseParser.cpp | 8 ++------ src/odb/src/3dblox/dbvParser.cpp | 2 +- src/odb/src/3dblox/dbxParser.cpp | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/odb/src/3dblox/baseParser.cpp b/src/odb/src/3dblox/baseParser.cpp index 0c676133937..e4a5076156d 100644 --- a/src/odb/src/3dblox/baseParser.cpp +++ b/src/odb/src/3dblox/baseParser.cpp @@ -174,12 +174,8 @@ void BaseParser::resolvePaths(const std::string& path, void BaseParser::logError(const std::string& message) { - if (!current_file_path_.empty()) { - logger_->error( - utl::ODB, 521, "Parser Error in {}: {}", current_file_path_, message); - } else { - logger_->error(utl::ODB, 521, "Parser Error: {}", message); - } + logger_->error( + utl::ODB, 521, "Parser Error in {}: {}", current_file_path_, message); } std::string BaseParser::trim(const std::string& str) diff --git a/src/odb/src/3dblox/dbvParser.cpp b/src/odb/src/3dblox/dbvParser.cpp index 495978d238e..672b7d5956d 100644 --- a/src/odb/src/3dblox/dbvParser.cpp +++ b/src/odb/src/3dblox/dbvParser.cpp @@ -27,7 +27,7 @@ DbvData DbvParser::parseFile(const std::string& filename) current_file_path_ = filename; std::ifstream file(filename); if (!file.is_open()) { - logError("3DBV Parser Error: Cannot open file"); + logError("Cannot open file"); } std::stringstream buffer; diff --git a/src/odb/src/3dblox/dbxParser.cpp b/src/odb/src/3dblox/dbxParser.cpp index 9bc4feffa4c..7fb597048e0 100644 --- a/src/odb/src/3dblox/dbxParser.cpp +++ b/src/odb/src/3dblox/dbxParser.cpp @@ -26,7 +26,7 @@ DbxData DbxParser::parseFile(const std::string& filename) current_file_path_ = filename; std::ifstream file(filename); if (!file.is_open()) { - logError("DBX Parser Error: Cannot open file"); + logError("Cannot open file"); } std::stringstream buffer;