Skip to content

Conversation

@saehejkang
Copy link
Contributor

@saehejkang saehejkang commented Jan 13, 2026

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Relates to #642.

  • Each image carries it own error message (allows for different error types per image)
  • Stdout/stderr support
  • Use of the new StderrLogHandler
container image inspect test python:alpine
// Inspect output for python:alpine here but omitted due to size
test: The operation couldn’t be completed. (ContainerizationError.ContainerizationError error 1.)
Error: InspectError(succeeded: ["docker.io/library/python:alpine"], failed: [("test", notFound: "Image not found")])

I found these updates make error propogation/handling a lot easier. If this is the correct direction we want to take, I will start by making updates to all the image commands before continuing on #832.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@saehejkang saehejkang changed the title image-inspect stdout/stderr refactor [image-inspect]: stdout/stderr and logging refactor Jan 13, 2026
@jglogan
Copy link
Contributor

jglogan commented Jan 13, 2026

Thanks for kicking this off!

I'm going to be pretty tied up today but I'll take a look at it later or tomorrow. There's #642 which you mentioned and also #268 which lacks actionable work but we should look it over and see if we can close that with the set of fixes like this.

@Ronitsabhaya75
Copy link
Contributor

@saehejkang Throwing InspectError at the end causes swift-argument-parser to print the raw struct details (e.g. Error: InspectError(...)) to stderr.

Since you are already logging specific errors via Logger, this final error print is redundant and noisy.

My Suggestion: Throw ExitCode.failure instead of InspectError to exit non-zero without extra noise, OR make InspectError conform to LocalizedError with a clean errorDescription.

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.

3 participants