]> Untitled Git - lemmy.git/commitdiff
Remove explicit panic from db connection code (fixes #2533) (#2535)
authorNutomic <me@nutomic.com>
Sat, 5 Nov 2022 00:53:46 +0000 (00:53 +0000)
committerGitHub <noreply@github.com>
Sat, 5 Nov 2022 00:53:46 +0000 (20:53 -0400)
src/main.rs

index 9ef2f541d27fa943d7d9facd6a7b6f0a2aeede55..4667df44a010e4a30c6955336fddd6c403cb8ff1 100644 (file)
@@ -78,8 +78,7 @@ async fn main() -> Result<(), LemmyError> {
   let pool = Pool::builder()
     .max_size(settings.database.pool_size)
     .min_idle(Some(1))
-    .build(manager)
-    .unwrap_or_else(|_| panic!("Error connecting to {}", db_url));
+    .build(manager)?;
 
   // Run the migrations from code
   let settings_cloned = settings.to_owned();