Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

graceful error handling

matthew-heartfulc39cc5653ad4
diff --git a/screenpipe-server/src/bin/screenpipe-server.rs b/screenpipe-server/src/bin/screenpipe-server.rs
index 4aa9b4c5b..0f371fc64 100644
--- a/screenpipe-server/src/bin/screenpipe-server.rs
+++ b/screenpipe-server/src/bin/screenpipe-server.rs
@@ -229,7 +229,10 @@ async fn main() -> anyhow::Result<()> {
let db = Arc::new(
DatabaseManager::new(&format!("{}/db.sqlite", local_data_dir))
.await
- .unwrap(),
+ .map_err(|e| {
+ eprintln!("Failed to initialize database: {:?}", e);
+ e
+ })?
);
info!(
"Database initialized, will store files in {}",
@@ -298,4 +301,4 @@ async fn main() -> anyhow::Result<()> {
loop {
tokio::time::sleep(Duration::from_secs(1)).await;
}
-}
+}
\ No newline at end of file