comparison OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp @ 2936:4b3929668358

create-dicom: more logs in case of error
author am@osimis.io
date Wed, 28 Nov 2018 14:36:09 +0100
parents 5dd649de253d
children 4ceb9bf7b00c
comparison
equal deleted inserted replaced
2935:aeeb40a35ce1 2936:4b3929668358
269 const Json::Value& tags, 269 const Json::Value& tags,
270 bool decodeBinaryTags) 270 bool decodeBinaryTags)
271 { 271 {
272 if (tags.type() != Json::objectValue) 272 if (tags.type() != Json::objectValue)
273 { 273 {
274 LOG(ERROR) << "Tags field is not an array";
274 throw OrthancException(ErrorCode_BadRequest); 275 throw OrthancException(ErrorCode_BadRequest);
275 } 276 }
276 277
277 // Inject the user-specified tags 278 // Inject the user-specified tags
278 Json::Value::Members members = tags.getMemberNames(); 279 Json::Value::Members members = tags.getMemberNames();
294 tag != DICOM_TAG_SERIES_TIME && 295 tag != DICOM_TAG_SERIES_TIME &&
295 tag != DICOM_TAG_STUDY_DATE && 296 tag != DICOM_TAG_STUDY_DATE &&
296 tag != DICOM_TAG_STUDY_TIME && 297 tag != DICOM_TAG_STUDY_TIME &&
297 dicom.HasTag(tag)) 298 dicom.HasTag(tag))
298 { 299 {
300 LOG(ERROR) << EnumerationToString(ErrorCode_CreateDicomOverrideTag) << ": " << name;
299 throw OrthancException(ErrorCode_CreateDicomOverrideTag); 301 throw OrthancException(ErrorCode_CreateDicomOverrideTag);
300 } 302 }
301 303
302 if (tag == DICOM_TAG_PIXEL_DATA) 304 if (tag == DICOM_TAG_PIXEL_DATA)
303 { 305 {
306 LOG(ERROR) << EnumerationToString(ErrorCode_CreateDicomUseContent);
304 throw OrthancException(ErrorCode_CreateDicomUseContent); 307 throw OrthancException(ErrorCode_CreateDicomUseContent);
305 } 308 }
306 else 309 else
307 { 310 {
308 dicom.Replace(tag, tags[name], decodeBinaryTags, DicomReplaceMode_InsertIfAbsent); 311 dicom.Replace(tag, tags[name], decodeBinaryTags, DicomReplaceMode_InsertIfAbsent);