Mercurial > hg > orthanc
diff Core/Compression/ZipWriter.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 | 878b59270859 |
children | 4e43e67f8ecf |
line wrap: on
line diff
--- a/Core/Compression/ZipWriter.cpp Mon Dec 03 11:49:39 2018 +0100 +++ b/Core/Compression/ZipWriter.cpp Mon Dec 03 14:35:34 2018 +0100 @@ -124,8 +124,8 @@ if (path_.size() == 0) { - LOG(ERROR) << "Please call SetOutputPath() before creating the file"; - throw OrthancException(ErrorCode_BadSequenceOfCalls); + throw OrthancException(ErrorCode_BadSequenceOfCalls, + "Please call SetOutputPath() before creating the file"); } hasFileInZip_ = false; @@ -168,8 +168,8 @@ { if (level >= 10) { - LOG(ERROR) << "ZIP compression level must be between 0 (no compression) and 9 (highest compression)"; - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw OrthancException(ErrorCode_ParameterOutOfRange, + "ZIP compression level must be between 0 (no compression) and 9 (highest compression)"); } Close(); @@ -228,8 +228,7 @@ { if (!hasFileInZip_) { - LOG(ERROR) << "Call first OpenFile()"; - throw OrthancException(ErrorCode_BadSequenceOfCalls); + throw OrthancException(ErrorCode_BadSequenceOfCalls, "Call first OpenFile()"); } const size_t maxBytesInAStep = std::numeric_limits<int32_t>::max();