From: Joel Rosdahl Date: Wed, 19 Jul 2023 13:55:52 +0000 (+0200) Subject: fix: Properly signal error on copy failure X-Git-Tag: v4.9~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60bec0a74a4a624563be75df115f889640d6c39e;p=thirdparty%2Fccache.git fix: Properly signal error on copy failure Restores behavior before 73a4585a58d5ab818a864485708d706532dfa3b4. --- diff --git a/src/storage/local/LocalStorage.cpp b/src/storage/local/LocalStorage.cpp index 883b093f9..3e5abe507 100644 --- a/src/storage/local/LocalStorage.cpp +++ b/src/storage/local/LocalStorage.cpp @@ -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( + util::copy_file(source, + dest, + via_tmp_file ? util::ViaTmpFile::yes + : util::ViaTmpFile::no), + FMT("Failed to copy {} to {}: ", source, dest)); } void