Ensure we provide a Transport::message() when we can

This commit is contained in:
Martin Algesten
2021-12-19 12:46:27 +01:00
parent 6a094db668
commit f3857eed00
7 changed files with 39 additions and 22 deletions

View File

@@ -613,7 +613,9 @@ fn parse_status_line(line: &str) -> Result<(ResponseStatusIndex, u16), Error> {
return Err(BadStatus.msg("Status code was wrong length"));
}
let status: u16 = status_str.parse().map_err(|_| BadStatus.new())?;
let status: u16 = status_str
.parse()
.map_err(|_| BadStatus.msg(format!("unable to parse status as u16 ({})", status_str)))?;
Ok((
ResponseStatusIndex {