]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Properly signal error on copy failure
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 19 Jul 2023 13:55:52 +0000 (15:55 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 25 Jul 2023 06:54:45 +0000 (08:54 +0200)
Restores behavior before 73a4585a58d5ab818a864485708d706532dfa3b4.

src/storage/local/LocalStorage.cpp

index 883b093f9ae2467cd79ae61c4820dc4d70dcd4c1..3e5abe50745e364c5c43b99b303536cccf0bc977 100644 (file)
@@ -682,8 +682,12 @@ LocalStorage::clone_hard_link_or_copy_file(const std::string& source,
   }
 
   LOG("Copying {} to {}", source, dest);
-  util::copy_file(
-    source, dest, via_tmp_file ? util::ViaTmpFile::yes : util::ViaTmpFile::no);
+  util::throw_on_error<core::Error>(
+    util::copy_file(source,
+                    dest,
+                    via_tmp_file ? util::ViaTmpFile::yes
+                                 : util::ViaTmpFile::no),
+    FMT("Failed to copy {} to {}: ", source, dest));
 }
 
 void