Skip to content

Commit

Permalink
adds get blocks error log
Browse files Browse the repository at this point in the history
  • Loading branch information
Zack-Xb committed Apr 17, 2024
1 parent 0fa63c9 commit 00f1ea2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/aleo_tools/api/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ impl<N: Network> AleoAPIClient<N> {
);
match self.client.get(&url).call()?.into_json() {
Ok(blocks) => Ok(blocks),
Err(error) => match error.to_string().as_str().contains("Cannot create a block with zero transactions") {
Err(error) =>{
println!("Get Blocks Error {}", error.to_string());
match error.to_string().as_str().contains("Cannot create a block with zero transactions") {
true => bail!("zero txs error"),
false => bail!("Failed to parse blocks {start_height} (inclusive) to {end_height} (exclusive): {error}"),
}
}}
}
}

Expand Down

0 comments on commit 00f1ea2

Please sign in to comment.