Browse Source

log errors when desktop fails to read the head

Evan Almloff 1 year ago
parent
commit
1cbf549847
1 changed files with 7 additions and 1 deletions
  1. 7 1
      packages/desktop/src/webview.rs

+ 7 - 1
packages/desktop/src/webview.rs

@@ -25,7 +25,13 @@ pub fn build(
         }
         #[cfg(not(debug_assertions))]
         {
-            std::fs::read_to_string("dist/__assets_head.html").ok()
+            match std::fs::read_to_string("./dist/__assets_head.html") {
+                Ok(s) => Some(s),
+                Err(err) => {
+                    log::error!("Failed to read ./dist/__assets_head.html: {}", err);
+                    None
+                }
+            }
         }
     };