comparison OrthancServer/ServerContext.cpp @ 2956:bfee0b9f3209

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Dec 2018 15:11:42 +0100
parents dc18d5804746
children 9c0b0a6d8b54
comparison
equal deleted inserted replaced
2955:bbfd95a0c429 2956:bfee0b9f3209
536 result = summary.toStyledString(); 536 result = summary.toStyledString();
537 537
538 if (!AddAttachment(instancePublicId, FileContentType_DicomAsJson, 538 if (!AddAttachment(instancePublicId, FileContentType_DicomAsJson,
539 result.c_str(), result.size())) 539 result.c_str(), result.size()))
540 { 540 {
541 LOG(WARNING) << "Cannot associate the DICOM-as-JSON summary to instance: " << instancePublicId; 541 throw OrthancException(ErrorCode_InternalError,
542 throw OrthancException(ErrorCode_InternalError); 542 "Cannot associate the DICOM-as-JSON summary to instance: " + instancePublicId);
543 } 543 }
544 } 544 }
545 } 545 }
546 546
547 547
596 bool uncompressIfNeeded) 596 bool uncompressIfNeeded)
597 { 597 {
598 FileInfo attachment; 598 FileInfo attachment;
599 if (!index_.LookupAttachment(attachment, instancePublicId, content)) 599 if (!index_.LookupAttachment(attachment, instancePublicId, content))
600 { 600 {
601 LOG(WARNING) << "Unable to read attachment " << EnumerationToString(content) << " of instance " << instancePublicId; 601 throw OrthancException(ErrorCode_InternalError,
602 throw OrthancException(ErrorCode_InternalError); 602 "Unable to read attachment " + EnumerationToString(content) +
603 " of instance " + instancePublicId);
603 } 604 }
604 605
605 if (uncompressIfNeeded) 606 if (uncompressIfNeeded)
606 { 607 {
607 ReadAttachment(result, attachment); 608 ReadAttachment(result, attachment);