]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
chore: Improve log message about too many raw file entries
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 9 Aug 2022 12:44:14 +0000 (14:44 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 20 Aug 2022 12:27:59 +0000 (14:27 +0200)
(cherry picked from commit 94508882ca6a9b715b02de5d9f2d14de69496af7)

src/Result.cpp

index 36ff33997f01c94a9ae65bcc833087dcc286bbd4..057b7fbeed7ed6a24cef6626cdfd12daa27f76e7 100644 (file)
@@ -83,6 +83,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(string_view result_path, uint8_t entry_number)
 {
@@ -217,8 +219,9 @@ Reader::read(Consumer& consumer)
   }
 
   const auto n_entries = m_reader.read_int<uint8_t>();
-  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;