Mercurial > hg > orthanc
diff OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp @ 5414:d5c15e9a63dd
more verbose error
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 08 Nov 2023 16:02:58 +0100 |
parents | 138e9d0c08c1 |
children | 59e3b6f8c5be |
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Wed Nov 08 16:01:42 2023 +0100 +++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Wed Nov 08 16:02:58 2023 +0100 @@ -1574,7 +1574,8 @@ static bool SaveToMemoryBufferInternal(std::string& buffer, DcmFileFormat& dicom, - E_TransferSyntax xfer) + E_TransferSyntax xfer, + std::string& errorMessage) { E_EncodingType encodingType = /*opt_sequenceType*/ EET_ExplicitLength; @@ -1613,14 +1614,24 @@ { // Error buffer.clear(); + errorMessage = std::string(c.text()); return false; } } - bool FromDcmtkBridge::SaveToMemoryBuffer(std::string& buffer, DcmDataset& dataSet) { + std::string errorMessageNotUsed; + return SaveToMemoryBuffer(buffer, dataSet, errorMessageNotUsed); + } + + + + bool FromDcmtkBridge::SaveToMemoryBuffer(std::string& buffer, + DcmDataset& dataSet, + std::string& errorMessage) + { // Determine the transfer syntax which shall be used to write the // information to the file. If not possible, switch to the Little // Endian syntax, with explicit length. @@ -1647,7 +1658,7 @@ ff.validateMetaInfo(xfer); ff.removeInvalidGroups(); - return SaveToMemoryBufferInternal(buffer, ff, xfer); + return SaveToMemoryBufferInternal(buffer, ff, xfer, errorMessage); }