# HG changeset patch # User Alain Mazy # Date 1569253692 -7200 # Node ID 00b0f4ce84e2c98edbc92b538ac49765d6915cb8 # Parent 793c141be598078ea059cd3cc95210e699026db1# Parent 77bede920d2255ef3c71e806720979ec6d6c7feb merge diff -r 77bede920d22 -r 00b0f4ce84e2 Core/SystemToolbox.cpp --- a/Core/SystemToolbox.cpp Thu Sep 19 13:11:11 2019 +0200 +++ b/Core/SystemToolbox.cpp Mon Sep 23 17:48:12 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 77bede920d22 -r 00b0f4ce84e2 Core/SystemToolbox.h --- a/Core/SystemToolbox.h Thu Sep 19 13:11:11 2019 +0200 +++ b/Core/SystemToolbox.h Mon Sep 23 17:48:12 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,