diff Framework/Common/DatabaseManager.cpp @ 445:cec6a0cd399f pg-transactions

now logging DatabaseCannotSerialize as a warning only with the details (Orthanc will log it as an error after all retries)
author Alain Mazy <am@osimis.io>
date Wed, 10 Jan 2024 15:25:03 +0100
parents 326f8304daa1
children 6780dd8b0a66
line wrap: on
line diff
--- a/Framework/Common/DatabaseManager.cpp	Wed Jan 10 15:22:40 2024 +0100
+++ b/Framework/Common/DatabaseManager.cpp	Wed Jan 10 15:25:03 2024 +0100
@@ -493,7 +493,7 @@
 
         default:
           // LOG(ERROR) << value.GetType();
-          throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
+          throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "The returned field is not of the correct type (Integer64)");
       }
     }
   }
@@ -511,8 +511,7 @@
 
       if (value != static_cast<int64_t>(static_cast<int32_t>(value)))
       {
-        LOG(ERROR) << "Integer overflow";
-        throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
+        throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "Integer overflow");
       }
       else
       {
@@ -546,8 +545,7 @@
         return dynamic_cast<const Utf8StringValue&>(value).GetContent();
 
       default:
-        //LOG(ERROR) << value.Format();
-        throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
+        throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "The returned field is not of the correct type (String)");
     }
   }