# HG changeset patch # User Sebastien Jodogne # Date 1569341216 -7200 # Node ID d96379a965dea008c844da70ad437af822967bb6 # Parent c8e706b519cd71e75d151c4bb182e90796241130# Parent 00b0f4ce84e2c98edbc92b538ac49765d6915cb8 merge diff -r c8e706b519cd -r d96379a965de Core/SystemToolbox.cpp --- a/Core/SystemToolbox.cpp Tue Sep 24 18:06:41 2019 +0200 +++ b/Core/SystemToolbox.cpp Tue Sep 24 18:06:56 2019 +0200 @@ -212,19 +212,23 @@ void SystemToolbox::ReadFile(std::string& content, - const std::string& path) + const std::string& path, + bool log) { if (!IsRegularFile(path)) { throw OrthancException(ErrorCode_RegularFileExpected, - "The path does not point to a regular file: " + path); + "The path does not point to a regular file: " + path, + log); } boost::filesystem::ifstream f; f.open(path, std::ifstream::in | std::ifstream::binary); if (!f.good()) { - throw OrthancException(ErrorCode_InexistentFile); + throw OrthancException(ErrorCode_InexistentFile, + "File not found: " + path, + log); } std::streamsize size = GetStreamSize(f); diff -r c8e706b519cd -r d96379a965de Core/SystemToolbox.h --- a/Core/SystemToolbox.h Tue Sep 24 18:06:41 2019 +0200 +++ b/Core/SystemToolbox.h Tue Sep 24 18:06:56 2019 +0200 @@ -59,7 +59,8 @@ ServerBarrierEvent ServerBarrier(); void ReadFile(std::string& content, - const std::string& path); + const std::string& path, + bool log = true); bool ReadHeader(std::string& header, const std::string& path,