changeset 92:ee5288834686

fix compatibility with older orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 Oct 2025 10:03:23 +0100
parents 1a95439d88bf
children 3ddff25fd054
files Framework/DownloadArea.cpp
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/DownloadArea.cpp	Tue Oct 07 10:22:20 2025 +0200
+++ b/Framework/DownloadArea.cpp	Thu Oct 30 10:03:23 2025 +0100
@@ -57,7 +57,15 @@
 
       if (!stream_.good())
       {
-        throw Orthanc::OrthancException(Orthanc::ErrorCode_CannotWriteFile, std::string("Unable to write to ") + Orthanc::SystemToolbox::PathToUtf8(f.GetPath()));
+        std::string path;
+
+#if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 12, 10)
+        path = Orthanc::SystemToolbox::PathToUtf8(f.GetPath());
+#else
+        path = f.GetPath();
+#endif
+
+        throw Orthanc::OrthancException(Orthanc::ErrorCode_CannotWriteFile, std::string("Unable to write to ") + path);
       }
     }