Skip to content

Commit 55ffd26

Browse files
authored
Merge pull request #643 from tnull/2025-09-try-log-status
Try to log status code for `reqwest`'s `Request` error kind
2 parents 65945f8 + 904a05f commit 55ffd26

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/chain/esplora.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,22 @@ impl EsploraChainSource {
144144
},
145145
Err(e) => match *e {
146146
esplora_client::Error::Reqwest(he) => {
147-
log_error!(
148-
self.logger,
149-
"{} of on-chain wallet failed due to HTTP connection error: {}",
150-
if incremental_sync { "Incremental sync" } else { "Sync" },
151-
he
152-
);
147+
if let Some(status_code) = he.status() {
148+
log_error!(
149+
self.logger,
150+
"{} of on-chain wallet failed due to HTTP {} error: {}",
151+
if incremental_sync { "Incremental sync" } else { "Sync" },
152+
status_code,
153+
he,
154+
);
155+
} else {
156+
log_error!(
157+
self.logger,
158+
"{} of on-chain wallet failed due to HTTP error: {}",
159+
if incremental_sync { "Incremental sync" } else { "Sync" },
160+
he,
161+
);
162+
}
153163
Err(Error::WalletOperationFailed)
154164
},
155165
_ => {

0 commit comments

Comments
 (0)