Add some better logging for get_outputs_by_id failure states (#2705)

This commit is contained in:
Mark Renten
2019-03-25 10:17:47 -04:00
committed by hashmap
parent 3566da2434
commit c3cd98cae7
4 changed files with 20 additions and 12 deletions
+3 -2
View File
@@ -203,8 +203,9 @@ fn send_request_async(req: Request<Body>) -> Box<dyn Future<Item = String, Error
.and_then(|resp| {
if !resp.status().is_success() {
Either::A(err(ErrorKind::RequestError(format!(
"Wrong response code: {}",
resp.status()
"Wrong response code: {} with data {:?}",
resp.status(),
resp.body()
))
.into()))
} else {
+7 -3
View File
@@ -106,9 +106,13 @@ impl OutputHandler {
let mut outputs: Vec<Output> = vec![];
for x in commitments {
if let Ok(output) = self.get_output(&x) {
outputs.push(output);
}
match self.get_output(&x) {
Ok(output) => outputs.push(output),
Err(e) => error!(
"Failure to get output for commitment {} with error {}",
x, e
),
};
}
Ok(outputs)
}