diff Plugins/Engine/OrthancPluginDatabase.cpp @ 2956:bfee0b9f3209

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Dec 2018 15:11:42 +0100
parents e583478e0c6c
children 8336204d95dc 4e43e67f8ecf
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPluginDatabase.cpp	Mon Dec 03 14:59:23 2018 +0100
+++ b/Plugins/Engine/OrthancPluginDatabase.cpp	Mon Dec 03 15:11:42 2018 +0100
@@ -280,8 +280,8 @@
   {
     if (extensions_.getAllInternalIds == NULL)
     {
-      LOG(ERROR) << "The database plugin does not implement the GetAllInternalIds primitive";
-      throw OrthancException(ErrorCode_DatabasePlugin);
+      throw OrthancException(ErrorCode_DatabasePlugin,
+                             "The database plugin does not implement the GetAllInternalIds primitive");
     }
 
     ResetAnswers();
@@ -618,8 +618,8 @@
   {
     if (extensions_.lookupIdentifier3 == NULL)
     {
-      LOG(ERROR) << "The database plugin does not implement the LookupIdentifier3 primitive";
-      throw OrthancException(ErrorCode_DatabasePlugin);
+      throw OrthancException(ErrorCode_DatabasePlugin,
+                             "The database plugin does not implement the LookupIdentifier3 primitive");
     }
 
     OrthancPluginDicomTag tmp;
@@ -736,8 +736,8 @@
   {
     if (extensions_.clearMainDicomTags == NULL)
     {
-      LOG(ERROR) << "Your custom index plugin does not implement the ClearMainDicomTags() extension";
-      throw OrthancException(ErrorCode_DatabasePlugin);
+      throw OrthancException(ErrorCode_DatabasePlugin,
+                             "Your custom index plugin does not implement the ClearMainDicomTags() extension");
     }
 
     CheckSuccess(extensions_.clearMainDicomTags(payload_, id));
@@ -971,14 +971,15 @@
           break;
 
         default:
-          LOG(ERROR) << "Unhandled type of answer for custom index plugin: " << answer.type;
-          throw OrthancException(ErrorCode_DatabasePlugin);
+          throw OrthancException(ErrorCode_DatabasePlugin,
+                                 "Unhandled type of answer for custom index plugin: " +
+                                 boost::lexical_cast<std::string>(answer.type));
       }
     }
     else if (type_ != answer.type)
     {
-      LOG(ERROR) << "Error in the plugin protocol: Cannot change the answer type";
-      throw OrthancException(ErrorCode_DatabasePlugin);
+      throw OrthancException(ErrorCode_DatabasePlugin,
+                             "Error in the plugin protocol: Cannot change the answer type");
     }
 
     switch (answer.type)
@@ -1098,8 +1099,9 @@
       }
 
       default:
-        LOG(ERROR) << "Unhandled type of answer for custom index plugin: " << answer.type;
-        throw OrthancException(ErrorCode_DatabasePlugin);
+        throw OrthancException(ErrorCode_DatabasePlugin,
+                               "Unhandled type of answer for custom index plugin: " +
+                               boost::lexical_cast<std::string>(answer.type));
     }
   }
 }