cli: Suggest the user to reset the cache
If there is an error loading a patch or issue, suggest resetting the cache.
This commit is contained in:
parent
c6a8a00055
commit
a496190198
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue