]> 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>
Mon, 15 Aug 2022 20:13:31 +0000 (22:13 +0200)
src/Result.cpp

index bc7c313d6c21c5e8d85b5211da315faa0b0f5caa..0129741181411e07967cea094f10cbd6daaf9a2f 100644 (file)
@@ -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<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;