diff options
Diffstat (limited to 'rust/src/lib.rs')
-rw-r--r-- | rust/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 86e367e4..fd871f55 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -66,7 +66,8 @@ pub fn establish_connection() -> PgConnection { dotenv().ok(); let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set"); - PgConnection::establish(&database_url).expect(&format!("Error connecting to {}", database_url)) + PgConnection::establish(&database_url) + .unwrap_or_else(|_| panic!("Error connecting to {}", database_url)) } /// Instantiate a new API server with a pooled database connection |