Have simple-request return an error upon failing to find the system's root certificates

This commit is contained in:
Luke Parker
2025-09-18 17:03:16 -04:00
parent 10c126ad92
commit 18a9cf2535
11 changed files with 34 additions and 28 deletions

View File

@@ -158,7 +158,7 @@ impl Serai {
}
pub async fn new(url: String) -> Result<Self, SeraiError> {
let client = Client::with_connection_pool();
let client = Client::with_connection_pool().map_err(|_| SeraiError::ConnectionError)?;
let mut res = Serai { url, client, genesis: [0xfe; 32] };
res.genesis = res.block_hash(0).await?.ok_or_else(|| {
SeraiError::InvalidNode("node didn't have the first block's hash".to_string())