From 1f35ffcf594f55d1e7c708e72a62bf5d8b3595f2 Mon Sep 17 00:00:00 2001 From: Lol3rrr Date: Tue, 31 Oct 2023 00:15:55 +0100 Subject: [PATCH] Another small change --- src/storage/files.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/storage/files.rs b/src/storage/files.rs index d119402..ea7da1a 100644 --- a/src/storage/files.rs +++ b/src/storage/files.rs @@ -35,11 +35,17 @@ impl StorageBackend for FileStorage { let path = self.path.clone(); Box::pin(async move { - if path.exists() { - tokio::fs::File::create(&path).await.map_err(|e| ())?; + if !path.exists() { + tokio::fs::File::create(&path).await.map_err(|e| { + tracing::error!("Creating file {:?}", e); + () + })?; } - tokio::fs::write(&path, &content).await.map_err(|e| ()) + tokio::fs::write(&path, &content).await.map_err(|e| { + tracing::error!("Writing File {:?}", e); + () + }) }) }