Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Suggest the user to reset the cache
cloudhead committed 1 year ago
commit a496190198bd5dc0eb741c57a87fe4112ba32647
parent c6a8a0005501e03573387065bc783ea7d94ee7b0
2 files changed +10 -2
modified radicle-cli/src/commands/issue.rs
@@ -496,7 +496,11 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
        Operation::Show { id, format, debug } => {
            let id = id.resolve(&repo.backend)?;
            let issue = issues
-
                .get(&id)?
+
                .get(&id)
+
                .map_err(|e| Error::WithHint {
+
                    err: e.into(),
+
                    hint: "reset the cache with `rad issue cache` and try again",
+
                })?
                .context("No issue with the given ID exists")?;
            if debug {
                println!("{:#?}", issue);
modified radicle-cli/src/commands/patch/show.rs
@@ -33,7 +33,11 @@ pub fn run(
    workdir: Option<&git::raw::Repository>,
) -> anyhow::Result<()> {
    let patches = profile.patches(stored)?;
-
    let Some(patch) = patches.get(patch_id)? else {
+
    let Some(patch) = patches.get(patch_id).map_err(|e| Error::WithHint {
+
        err: e.into(),
+
        hint: "reset the cache with `rad patch cache` and try again",
+
    })?
+
    else {
        anyhow::bail!("Patch `{patch_id}` not found");
    };