Improve error handling for nonexistent channels
[?]
May 31, 2021, 6:02 PM
GFED4ORASDTMUQUCOXXZMOXSR6JJGCP3IEM3SMDG52GX2NMXC4GQCDependencies
- [2]
GYXIF25TProper parsing of URLs - [3]
JRENVH5DReqwest 0.11 - [4]
TPEH2XNB1.0.0-alpha.28, with Tokio 1.0 - [5]
MU5GSJAWPartial push and pull (WARNING: breaks the existing protocol) - [6]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [*]
FBXYP7QMForgot to add remote::http
Change contents
- replacement in pijul/src/remote/http.rs at line 182[3.207]→[3.5653:5693](∅→∅),[3.1457]→[3.5653:5693](∅→∅),[2.1924]→[3.5653:5693](∅→∅),[3.5653]→[3.5653:5693](∅→∅),[3.5693]→[3.11188:11239](∅→∅)
if !res.status().is_success() {bail!("HTTP error {:?}", res.status())let status = res.status();if !status.is_success() {match serde_json::from_slice::<libpijul::RemoteError>(&*res.bytes().await?) {Ok(remote_err) => return Err(remote_err.into()),Err(_) if status.as_u16() == 404 => bail!("Repository `{}` not found (404)", self.url),Err(_) => bail!("Http request failed with status code: {}", status)}