diff --git a/server/src/db/mod.rs b/server/src/db/mod.rs index c25a645..fef3ffc 100644 --- a/server/src/db/mod.rs +++ b/server/src/db/mod.rs @@ -112,7 +112,7 @@ impl MaybeOptional for Option { pub fn establish_unpooled_connection() -> PgConnection { let db_url = Settings::get().get_database_url(); - PgConnection::establish(&db_url).expect(&format!("Error connecting to {}", db_url)) + PgConnection::establish(&db_url).unwrap_or_else(|_| panic!("Error connecting to {}", db_url)) } #[derive(EnumString, ToString, Debug, Serialize, Deserialize)]