From 8771a378da68acd3b6baa2badbe48da173291c13 Mon Sep 17 00:00:00 2001 From: philipp Date: Tue, 16 Apr 2024 09:06:24 +0200 Subject: [PATCH] fix ci --- src/tera/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tera/mod.rs b/src/tera/mod.rs index 3b12831..641a4a9 100644 --- a/src/tera/mod.rs +++ b/src/tera/mod.rs @@ -139,11 +139,17 @@ impl Fairing for Usage { if !uri.ends_with(".css") && !uri.ends_with(".js") { let config = req.rocket().state::().unwrap(); - let mut file = OpenOptions::new() + let Ok(mut file) = OpenOptions::new() .write(true) .append(true) .open(config.usage_log_path.clone()) - .unwrap(); + else { + eprintln!( + "File {} can't be found, not saving usage logs", + config.usage_log_path.clone() + ); + return; + }; if let Err(e) = writeln!(file, "{timestamp};{user};{uri}") { eprintln!("Couldn't write to file: {}", e); -- 2.45.2