changeset 3670:e64432336055 storage-commitment

integration mainline->storage-commitment
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Feb 2020 09:05:06 +0100
parents adb6d8b49283 (current diff) 445bda258245 (diff)
children 3e68c3b4e3df
files Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Thu Feb 13 18:44:53 2020 +0100
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Fri Feb 14 09:05:06 2020 +0100
@@ -2172,8 +2172,13 @@
   
     if (body.type() != Json::objectValue)
     {
+#if HAS_ORTHANC_EXCEPTION == 1
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat,
                                       "Expected a JSON object in the body");
+#else
+      LogError("Expected a JSON object in the body");
+      ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat);
+#endif
     }
 
     bool synchronous = true;
@@ -2182,9 +2187,14 @@
     {
       if (body[KEY_SYNCHRONOUS].type() != Json::booleanValue)
       {
+#if HAS_ORTHANC_EXCEPTION == 1
         throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat,
                                         "Option \"" + std::string(KEY_SYNCHRONOUS) +
                                         "\" must be Boolean");
+#else
+        LogError("Option \"" + std::string(KEY_SYNCHRONOUS) + "\" must be Boolean");
+        ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat);
+#endif
       }
       else
       {
@@ -2196,9 +2206,14 @@
     {
       if (body[KEY_ASYNCHRONOUS].type() != Json::booleanValue)
       {
+#if HAS_ORTHANC_EXCEPTION == 1
         throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat,
                                         "Option \"" + std::string(KEY_ASYNCHRONOUS) +
                                         "\" must be Boolean");
+#else
+        LogError("Option \"" + std::string(KEY_ASYNCHRONOUS) + "\" must be Boolean");
+        ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat);
+#endif
       }
       else
       {
@@ -2212,9 +2227,14 @@
     {
       if (body[KEY_PRIORITY].type() != Json::booleanValue)
       {
+#if HAS_ORTHANC_EXCEPTION == 1
         throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat,
                                         "Option \"" + std::string(KEY_PRIORITY) +
                                         "\" must be an integer");
+#else
+        LogError("Option \"" + std::string(KEY_PRIORITY) + "\" must be an integer");
+        ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat);
+#endif
       }
       else
       {