diff Core/Compression/ZipWriter.cpp @ 3184:5d1f5984dc41

improved log
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 01 Feb 2019 09:28:12 +0100
parents 6fd38327e777
children 94f4a18a79cc
line wrap: on
line diff
--- a/Core/Compression/ZipWriter.cpp	Fri Feb 01 09:08:29 2019 +0100
+++ b/Core/Compression/ZipWriter.cpp	Fri Feb 01 09:28:12 2019 +0100
@@ -148,8 +148,8 @@
 
     if (!pimpl_->file_)
     {
-      LOG(ERROR) << "Cannot create new ZIP archive: " << path_;
-      throw OrthancException(ErrorCode_CannotWriteFile);
+      throw OrthancException(ErrorCode_CannotWriteFile,
+                             "Cannot create new ZIP archive: " + path_);
     }
   }
 
@@ -210,8 +210,8 @@
 
     if (result != 0)
     {
-      LOG(ERROR) << "Cannot add new file inside ZIP archive: " << path;
-      throw OrthancException(ErrorCode_CannotWriteFile);
+      throw OrthancException(ErrorCode_CannotWriteFile,
+                             "Cannot add new file inside ZIP archive: " + std::string(path));
     }
 
     hasFileInZip_ = true;
@@ -242,8 +242,8 @@
 
       if (zipWriteInFileInZip(pimpl_->file_, data, bytes))
       {
-        LOG(ERROR) << "Cannot write data to ZIP archive: " << path_;
-        throw OrthancException(ErrorCode_CannotWriteFile);
+        throw OrthancException(ErrorCode_CannotWriteFile,
+                               "Cannot write data to ZIP archive: " + path_);
       }
       
       data += bytes;