comparison OrthancServer/FromDcmtkBridge.cpp @ 1582:bd1889029cbb

encoding of exceptions
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 25 Aug 2015 17:39:38 +0200
parents ad1e127b4ed5
children 96582230ddcb
comparison
equal deleted inserted replaced
1581:357c4bb15701 1582:bd1889029cbb
213 DicomValue* FromDcmtkBridge::ConvertLeafElement(DcmElement& element, 213 DicomValue* FromDcmtkBridge::ConvertLeafElement(DcmElement& element,
214 Encoding encoding) 214 Encoding encoding)
215 { 215 {
216 if (!element.isLeaf()) 216 if (!element.isLeaf())
217 { 217 {
218 throw OrthancException("Only applicable to leaf elements"); 218 // This function is only applicable to leaf elements
219 throw OrthancException(ErrorCode_BadParameterType);
219 } 220 }
220 221
221 if (element.isaString()) 222 if (element.isaString())
222 { 223 {
223 char *c; 224 char *c;
592 const DcmDictEntry* entry = dict.findEntry(name); 593 const DcmDictEntry* entry = dict.findEntry(name);
593 594
594 if (entry == NULL) 595 if (entry == NULL)
595 { 596 {
596 dcmDataDict.unlock(); 597 dcmDataDict.unlock();
597 throw OrthancException("Unknown DICOM tag"); 598 throw OrthancException(ErrorCode_UnknownDicomTag);
598 } 599 }
599 else 600 else
600 { 601 {
601 DcmTagKey key = entry->getKey(); 602 DcmTagKey key = entry->getKey();
602 DicomTag tag(key.getGroup(), key.getElement()); 603 DicomTag tag(key.getGroup(), key.getElement());
609 { 610 {
610 return DicomTag(tag.getGTag(), tag.getETag()); 611 return DicomTag(tag.getGTag(), tag.getETag());
611 } 612 }
612 else 613 else
613 { 614 {
614 throw OrthancException("Unknown DICOM tag"); 615 throw OrthancException(ErrorCode_UnknownDicomTag);
615 } 616 }
616 #endif 617 #endif
617 } 618 }
618 619
619 620