Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.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 | 28979b77ce90 |
children | a03260db8835 |
comparison
equal
deleted
inserted
replaced
1757:28979b77ce90 | 1758:4ee11b8773e2 |
---|---|
90 Json::Value body; | 90 Json::Value body; |
91 message.ParseJsonBody(body); | 91 message.ParseJsonBody(body); |
92 | 92 |
93 if (body.type() != Json::objectValue) | 93 if (body.type() != Json::objectValue) |
94 { | 94 { |
95 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | 95 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadJson, "JSON body should be an object value"); |
96 } | 96 } |
97 | 97 |
98 std::unique_ptr<Orthanc::DicomMap> dicom(new Orthanc::DicomMap); | 98 std::unique_ptr<Orthanc::DicomMap> dicom(new Orthanc::DicomMap); |
99 dicom->FromDicomAsJson(body); | 99 dicom->FromDicomAsJson(body); |
100 | 100 |