We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5881ee3 commit 39bc197Copy full SHA for 39bc197
plugins/http/src/lib.rs
@@ -4,6 +4,8 @@
4
5
//! Access the HTTP client written in Rust.
6
7
+use std::io::Cursor;
8
+
9
pub use reqwest;
10
use tauri::{
11
plugin::{Builder, TauriPlugin},
@@ -46,7 +48,15 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
46
48
.open(&path)?;
47
49
50
let reader = BufReader::new(file);
- let store = CookieStoreMutex::load(reader).map_err(|e| e.to_string())?;
51
+ let store = CookieStoreMutex::load(reader)
52
+ .or_else(|_e| {
53
+ #[cfg(feature = "tracing")]
54
+ tracing::warn!(
55
+ "failed to load cookie store: {_e}, falling back to empty store"
56
+ );
57
+ CookieStoreMutex::load(Cursor::new("[]".to_string()))
58
+ })
59
+ .map_err(|e| e.to_string())?;
60
61
(path, Arc::new(store))
62
};
0 commit comments