-
Notifications
You must be signed in to change notification settings - Fork 198
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
libimage: Add input to error context when normalizing #1971
libimage: Add input to error context when normalizing #1971
Conversation
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes a lot of sense, however there are more reference.Parse()
callers here that do not wrap the error so I think they should be fixed too.
I also also wonder if this breaks podman tests that hard code certain error messages. Not a blocker of course just something that may needs chnages when vendoring the next time into podman |
Before, here's what happens if you forget a `-v` in your bind mount for example: ``` $ podman run /dev:/dev docker.io/busybox echo hello Error: invalid reference format $ ``` After: ``` $ podman run /dev:/dev docker.io/busybox echo hello Error: parsing reference "/dev:/dev": invalid reference format ``` This error prefixing is common in other callers. Signed-off-by: Colin Walters <walters@verbum.org>
067a4a9
to
2394c71
Compare
I looked at that, but my worry is we end up with double context somewhere; it's hard to trace through all these call chains (hmm, I wonder if someone wrote a tool for this). I decided to change the implementation so that just the two callers here of
Yeah, that seems possible. |
An alternative could be adding the context directly to the |
I was thinking about this too but then chances of including the path twice is higher as there seem to be many places already that wrap the error accordingly that would need to be changed back. |
Yes, this is “pay a little cost every time a new (And pedantically we might worry about starting to return a wrapped error , but nothing in Podman actually cares.) It’s ~50 non-test calls across Podman, so quite doable, but also not something I can prioritize working on short-term. Perhaps a good first PR for a new contributor. |
Lets get this fix in, and then we can look at moving it to containers/image later. |
Seems like a good idea to at least fix the bad podman run/create message for now. |
Before, here's what happens if you forget a
-v
in your bind mount for example:After:
This error prefixing is common in other callers.