# HG changeset patch # User Sebastien Jodogne # Date 1549009692 -3600 # Node ID 5d1f5984dc4170c7dfcb239d34de12e92f28994e # Parent 98187ab5a4c9b0ba8fdff8aeeb9cd6fdfe9cefb1 improved log diff -r 98187ab5a4c9 -r 5d1f5984dc41 Core/Compression/ZipWriter.cpp --- 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; diff -r 98187ab5a4c9 -r 5d1f5984dc41 Core/TemporaryFile.cpp --- a/Core/TemporaryFile.cpp Fri Feb 01 09:08:29 2019 +0100 +++ b/Core/TemporaryFile.cpp Fri Feb 01 09:28:12 2019 +0100 @@ -100,13 +100,13 @@ { SystemToolbox::WriteFile(content, path_); } - catch (OrthancException&) + catch (OrthancException& e) { - LOG(ERROR) << "Can't create temporary file \"" << path_ - << "\" with " << content.size() - << " bytes: Check you have write access to the " - << "temporary directory and that it is not full"; - throw; + throw OrthancException(e.GetErrorCode(), + "Can't create temporary file \"" + path_ + + "\" with " + boost::lexical_cast(content.size()) + + " bytes: Check you have write access to the " + "temporary directory and that it is not full"); } } @@ -117,11 +117,11 @@ { SystemToolbox::ReadFile(content, path_); } - catch (OrthancException&) + catch (OrthancException& e) { - LOG(ERROR) << "Can't read temporary file \"" << path_ - << "\": Another process has corrupted the temporary directory"; - throw; + throw OrthancException(e.GetErrorCode(), + "Can't read temporary file \"" + path_ + + "\": Another process has corrupted the temporary directory"); } } diff -r 98187ab5a4c9 -r 5d1f5984dc41 OrthancServer/OrthancConfiguration.cpp --- a/OrthancServer/OrthancConfiguration.cpp Fri Feb 01 09:08:29 2019 +0100 +++ b/OrthancServer/OrthancConfiguration.cpp Fri Feb 01 09:28:12 2019 +0100 @@ -834,7 +834,7 @@ { if (json_.isMember(TEMPORARY_DIRECTORY)) { - return new TemporaryFile(GetStringParameter(TEMPORARY_DIRECTORY, ""), ""); + return new TemporaryFile(InterpretStringParameterAsPath(GetStringParameter(TEMPORARY_DIRECTORY, ".")), ""); } else {