diff Framework/PostgreSQL/PostgreSQLStatement.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 dbf811b1bb43
children f0976163dbe1
line wrap: on
line diff
--- a/Framework/PostgreSQL/PostgreSQLStatement.cpp	Wed Jan 10 15:22:40 2024 +0100
+++ b/Framework/PostgreSQL/PostgreSQLStatement.cpp	Wed Jan 10 15:25:03 2024 +0100
@@ -287,7 +287,8 @@
       }
       
 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 2)
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_DatabaseCannotSerialize);
+      std::string errorString(PQresultErrorMessage(result));
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_DatabaseCannotSerialize, errorString, false); // don't log here, it is handled at higher level
 #else
       throw Orthanc::OrthancException(Orthanc::ErrorCode_Database, "Collision between multiple writers");
 #endif