# HG changeset patch # User Benjamin Golinvaux # Date 1619462498 -7200 # Node ID 4ee11b8773e21a3531130a5feef609bbbffd8866 # Parent 28979b77ce909164b4d1e3e2f74451c0678b0c37 Better error description in case of network json payload errors diff -r 28979b77ce90 -r 4ee11b8773e2 OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp --- a/OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp Mon Apr 26 17:37:54 2021 +0200 +++ b/OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp Mon Apr 26 20:41:38 2021 +0200 @@ -149,7 +149,7 @@ } const std::string msgStr = msg.str(); LOG(ERROR) << msgStr; - throw Orthanc::OrthancException(Orthanc::ErrorCode_UnknownResource); + throw Orthanc::OrthancException(Orthanc::ErrorCode_BadJson); } const std::string instanceId = lookup[0]["ID"].asString(); diff -r 28979b77ce90 -r 4ee11b8773e2 OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp --- a/OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp Mon Apr 26 17:37:54 2021 +0200 +++ b/OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp Mon Apr 26 20:41:38 2021 +0200 @@ -92,7 +92,7 @@ if (body.type() != Json::objectValue) { - throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); + throw Orthanc::OrthancException(Orthanc::ErrorCode_BadJson, "JSON body should be an object value"); } std::unique_ptr dicom(new Orthanc::DicomMap); diff -r 28979b77ce90 -r 4ee11b8773e2 OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp --- a/OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Mon Apr 26 17:37:54 2021 +0200 +++ b/OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Mon Apr 26 20:41:38 2021 +0200 @@ -350,7 +350,7 @@ if (body.type() != Json::objectValue) { - throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); + throw Orthanc::OrthancException(Orthanc::ErrorCode_BadJson, "JSON body should be an object value"); } { @@ -574,11 +574,11 @@ OrthancSeriesVolumeProgressiveLoader::~OrthancSeriesVolumeProgressiveLoader() { LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::~OrthancSeriesVolumeProgressiveLoader()"; - } - - void OrthancSeriesVolumeProgressiveLoader::SetStartCenter(bool startCenter) - { - startCenter_ = startCenter; + } + + void OrthancSeriesVolumeProgressiveLoader::SetStartCenter(bool startCenter) + { + startCenter_ = startCenter; } void OrthancSeriesVolumeProgressiveLoader::SetSimultaneousDownloads(unsigned int count)