canonical / canonical/chisel

UX: error on 'directory does not exist'

Open
#234 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
424
Forks
65
Avg merge
12d 19h
Merged PRs (30d)
1

Description

The error message when attempting to cut into a directory (to make sure all the slice is correct) is a bit confusing. When running: `chisel cut --release=./ --root=mych libgcc-14-dev_libs` i get `error: cannot extract from package "base-files": target directory does not exist` which gives me the full error hierarchy and points towards something wrong with the base-files, while the actual issue is that the directory `mych` does not exist.

As a UX feedback; I'd suggest caching this case and creating a more user friendly error. At least I'd present just the bottom error, and maybe even add the directory name. Something like `cannot cut into `mych` directory. it does not exist`.

I imagine this kind of treatment might be appropriate for some other errors, therefore my suggestion for reporting errors to the user would be to:

- allow the error to propagate to the topmost level normally - exactly as it is implemented at the moment
- just before passing the error to the user, check whether it is a special error which can be made more user friendly.
- Yes: report it like that
- No: Report it using the

I'm thinking of something along the lines of [`github.com/pkg/errors`](https://github.com/pkg/errors) used to do?

When I have some time I'm happy to look at the code and make a PR.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with `chisel cut --release=./ --root=mych libgcc-14-dev_libs` and trace how the missing `mych` directory error reaches the user. Done means the command reports a focused, user-friendly error naming `mych`, rather than exposing the `base-files` error hierarchy.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.