Skip to content

Commit

Permalink
feat: client shows status code, if available, on error
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Zak <richard.j.zak@gmail.com>
  • Loading branch information
rjzak committed Jul 5, 2024
1 parent 766e71e commit d697b3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,11 @@ impl MdbClient {
Ok(res.status().is_success())
}
Err(e) => {
error!("Error sending {file_name}: {e}");
let status: String = e
.status()
.map(|s| s.as_str().to_string())
.unwrap_or_default();
error!("Error{status} sending {file_name}: {e}");
bail!(e.to_string())
}
}
Expand Down

0 comments on commit d697b3f

Please sign in to comment.