A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/GitoxideLabs/gitoxide/issues/2055 below:

ref_map crashes in cases of error · Issue #2055 · GitoxideLabs/gitoxide · GitHub

Current behavior 😯

Hi! In gix/src/remote/connection/ref_map.rs: 88 there's the following code:

    pub async fn ref_map(
        mut self,
        progress: impl Progress,
        options: Options,
    ) -> Result<(fetch::RefMap, gix_protocol::handshake::Outcome), Error> {
        let refmap = self.ref_map_by_ref(progress, options).await;
        let handshake = self.handshake.expect("refmap always performs handshake");
        refmap.map(|map| (map, handshake))
    }

If ref_map_by_ref returns an error (for example, because of authentication) the code simply panics instead of forwarding witth a generic error, this is of course a problem, but also since the error is generic it makes it imposible to understand what went wrong and how to fix it.

Expected behavior 🤔

No response

Git behavior

The error just should be returned normally, and be taken into account by the user of the library.

Steps to reproduce 🕹

Personally, I get to this error by modifying connection prior to this call and setting authentication.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4