diff OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp @ 5414:d5c15e9a63dd

more verbose error
author Alain Mazy <am@osimis.io>
date Wed, 08 Nov 2023 16:02:58 +0100
parents c5f1865aaa3b
children cd90d8b4661e
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Wed Nov 08 16:01:42 2023 +0100
+++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Wed Nov 08 16:02:58 2023 +0100
@@ -939,9 +939,10 @@
 
   void ParsedDicomFile::SaveToMemoryBuffer(std::string& buffer)
   {
-    if (!FromDcmtkBridge::SaveToMemoryBuffer(buffer, *GetDcmtkObject().getDataset()))
+    std::string errorMessage;
+    if (!FromDcmtkBridge::SaveToMemoryBuffer(buffer, *GetDcmtkObject().getDataset(), errorMessage)
     {
-      throw OrthancException(ErrorCode_InternalError, "Cannot write DICOM file to memory");
+      throw OrthancException(ErrorCode_InternalError, "Cannot write DICOM file to memory, DCMTK error: " + errorMessage);
     }
   }