Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boundimage: Drop duplicate filenames from errors #696

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

cgwalters
Copy link
Collaborator

Two minor things:

  • I think it's cleanest to separate parsing from files; we were passing the file name to the parser just to include it in the error message
  • We had the file path twice in errors (once in the context, once in the returned error)

Fix both these things by using with_context that includes the path in the callers.

So the resulting error should look like e.g. Parsing /usr/lib/bootc/bound-images.d/foo.image: Missing Image field or so.

Two minor things:

- I think it's cleanest to separate parsing from files; we were
  passing the file name to the parser just to include it in
  the error message
- We had the file path *twice* in errors (once in the context,
  once in the returned error)

Fix both these things by using `with_context` that includes the
path in the callers.

So the resulting error should look like e.g. `Parsing
/usr/lib/bootc/bound-images.d/foo.image: Missing Image field`
or so.

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters requested a review from ckyrouac July 16, 2024 22:07
@cgwalters cgwalters merged commit 371156e into containers:main Jul 17, 2024
24 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants