From: Joel Rosdahl Date: Tue, 9 Aug 2022 12:44:14 +0000 (+0200) Subject: chore: Improve log message about too many raw file entries X-Git-Tag: v4.7~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=94508882ca6a9b715b02de5d9f2d14de69496af7;p=thirdparty%2Fccache.git chore: Improve log message about too many raw file entries --- diff --git a/src/Result.cpp b/src/Result.cpp index bc7c313d6..012974118 100644 --- a/src/Result.cpp +++ b/src/Result.cpp @@ -79,6 +79,8 @@ const uint8_t k_embedded_file_marker = 0; // File stored as-is in the file system. const uint8_t k_raw_file_marker = 1; +const uint8_t k_max_raw_file_entries = 10; + std::string get_raw_file_path(std::string_view result_path, uint8_t entry_number) { @@ -213,8 +215,9 @@ Reader::read(Consumer& consumer) } const auto n_entries = m_reader.read_int(); - if (n_entries >= 10) { - throw core::Error("Too many entries raw file entries: {}", n_entries); + if (n_entries >= k_max_raw_file_entries) { + throw core::Error( + "Too many raw file entries: {} > {}", n_entries, k_max_raw_file_entries); } uint8_t i;