Skip to content

Commit 2095d87

Browse files
authored
Merge pull request #417 from vincenzopalazzo/macros/esplora-api
undefined
2 parents 05130b6 + dc46a9d commit 2095d87

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/chain/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,8 @@ impl ChainSource {
991991
);
992992
},
993993
Err(e) => match e {
994-
esplora_client::Error::Reqwest(err) => {
995-
if err.status() == reqwest::StatusCode::from_u16(400).ok() {
994+
esplora_client::Error::HttpResponse { status, message } => {
995+
if status == 400 {
996996
// Log 400 at lesser level, as this often just means bitcoind already knows the
997997
// transaction.
998998
// FIXME: We can further differentiate here based on the error
@@ -1001,13 +1001,13 @@ impl ChainSource {
10011001
log_trace!(
10021002
logger,
10031003
"Failed to broadcast due to HTTP connection error: {}",
1004-
err
1004+
message
10051005
);
10061006
} else {
10071007
log_error!(
10081008
logger,
1009-
"Failed to broadcast due to HTTP connection error: {}",
1010-
err
1009+
"Failed to broadcast due to HTTP connection error: {} - {}",
1010+
status, message
10111011
);
10121012
}
10131013
log_trace!(

0 commit comments

Comments
 (0)