diff Core/Images/JpegWriter.cpp @ 2954:d924f9bb61cc

taking advantage of details in OrthancException
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Dec 2018 14:35:34 +0100
parents 52217dc47a4e
children 4e43e67f8ecf
line wrap: on
line diff
--- a/Core/Images/JpegWriter.cpp	Mon Dec 03 11:49:39 2018 +0100
+++ b/Core/Images/JpegWriter.cpp	Mon Dec 03 14:35:34 2018 +0100
@@ -149,8 +149,8 @@
        */
       jpeg_destroy_compress(&cinfo);
       fclose(fp);
-      LOG(ERROR) << "Error during JPEG encoding: " << jerr.GetMessage();
-      throw OrthancException(ErrorCode_InternalError);
+      throw OrthancException(ErrorCode_InternalError,
+                             "Error during JPEG encoding: " + jerr.GetMessage());
     }
 
     // Do not allocate data on the stack below this line!
@@ -193,8 +193,8 @@
         free(data);
       }
 
-      LOG(ERROR) << "Error during JPEG encoding: " << jerr.GetMessage();
-      throw OrthancException(ErrorCode_InternalError);
+      throw OrthancException(ErrorCode_InternalError,
+                             "Error during JPEG encoding: " + jerr.GetMessage());
     }
 
     // Do not allocate data on the stack below this line!