Improve error handling for nonexistent channels

[?]
May 31, 2021, 6:02 PM
GFED4ORASDTMUQUCOXXZMOXSR6JJGCP3IEM3SMDG52GX2NMXC4GQC

Dependencies

  • [2] GYXIF25T Proper parsing of URLs
  • [3] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [4] TPEH2XNB 1.0.0-alpha.28, with Tokio 1.0
  • [5] JRENVH5D Reqwest 0.11
  • [6] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [*] FBXYP7QM Forgot 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())
    [2.1924]
    [3.5813]
    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)
    }