# HG changeset patch # User Sebastien Jodogne # Date 1581667506 -3600 # Node ID e644323360552f78b01c7eefe6bb90b0b41ed3a9 # Parent adb6d8b49283cd2b26929eda5be3a924ce47ca48# Parent 445bda258245777cf4c9574b8013b557e056c126 integration mainline->storage-commitment diff -r adb6d8b49283 -r e64432336055 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- 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 {