diff options
-rw-r--r-- | src/cache/mod.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cache/mod.rs b/src/cache/mod.rs index ef8491a..a3e08c9 100644 --- a/src/cache/mod.rs +++ b/src/cache/mod.rs @@ -8,7 +8,7 @@ // You should have received a copy of the License along with this program. // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -use anyhow::Result; +use anyhow::{Context, Result}; use log::info; use tokio::fs; @@ -26,7 +26,13 @@ async fn invalidate_video(app: &App, video: &Video, hard: bool) -> Result<()> { if hard { if let Some(path) = &video.cache_path { info!("Removing cached video at: '{}'", path.display()); - fs::remove_file(path).await?; + fs::remove_file(path).await.with_context(|| { + format!( + "Failed to delete video ('{}') cache path: '{}'.", + video.title, + path.display() + ) + })?; } } |