From 06f68be9d20069f770e56cbc134ec2fba8e97b10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <henrik@trineo.org>
Date: Thu, 19 Aug 2021 20:37:51 +0200
Subject: [PATCH] ENH: log error messages

---
 src/caosdb/transaction.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/caosdb/transaction.cpp b/src/caosdb/transaction.cpp
index ac64e26..d7568d8 100644
--- a/src/caosdb/transaction.cpp
+++ b/src/caosdb/transaction.cpp
@@ -405,6 +405,10 @@ auto Transaction::WaitForIt() const noexcept -> TransactionStatus { // NOLINT
           find_result = std::make_unique<Entity>(&entity_response);
           if (find_result->HasErrors()) {
             set_error = true;
+            // log errors
+            for (auto &err : find_result->GetErrors()) {
+              CAOSDB_LOG_ERROR(logger_name) << err.GetDescription();
+            }
           }
           entities.push_back(std::move(find_result));
         }
@@ -443,6 +447,10 @@ auto Transaction::WaitForIt() const noexcept -> TransactionStatus { // NOLINT
     if (result != nullptr) {
       if (result->HasErrors()) {
         set_error = true;
+        // log errors
+        for (auto &err : result->GetErrors()) {
+          CAOSDB_LOG_ERROR(logger_name) << err.GetDescription();
+        }
       }
       entities.push_back(std::move(result));
     }
-- 
GitLab