Skip to content

Commit b85bf2c

Browse files
committed
fix: enhance error message clarity for database connection failures
1 parent 637f198 commit b85bf2c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/webserver/database/execute_queries.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@ async fn take_connection<'a>(
249249
Ok(conn.as_mut().unwrap())
250250
}
251251
Err(e) => {
252-
let err_msg = format!("Unable to acquire a database connection to execute the SQL file. All of the {} {:?} connections are busy.", db.connection.size(), db.connection.any_kind());
252+
let db_name = db.connection.any_kind();
253+
let active_count = db.connection.size();
254+
let err_msg = format!("Unable to acquire a {db_name:?} database connection to execute the SQL file. The connection pool currently has {active_count} active connections.");
253255
Err(anyhow::Error::new(e).context(err_msg))
254256
}
255257
}

0 commit comments

Comments
 (0)