comparison OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp @ 1758:4ee11b8773e2

Better error description in case of network json payload errors
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 26 Apr 2021 20:41:38 +0200
parents 1a775f4ee672
children 3889ae96d2e9
comparison
equal deleted inserted replaced
1757:28979b77ce90 1758:4ee11b8773e2
348 Json::Value body; 348 Json::Value body;
349 message.ParseJsonBody(body); 349 message.ParseJsonBody(body);
350 350
351 if (body.type() != Json::objectValue) 351 if (body.type() != Json::objectValue)
352 { 352 {
353 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); 353 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadJson, "JSON body should be an object value");
354 } 354 }
355 355
356 { 356 {
357 Json::Value::Members instances = body.getMemberNames(); 357 Json::Value::Members instances = body.getMemberNames();
358 358