Skip to content

Conversation

@jeckersb
Copy link
Collaborator

Signed-off-by: John Eckersberg jeckersb@redhat.com

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses an issue where the detailed message of Error::Other was being swallowed by thiserror, improving debuggability. The change is correct. I've added a comment suggesting a similar improvement for GetBlobError to ensure consistent error reporting throughout the crate.

@jeckersb
Copy link
Collaborator Author

Before:

⬢ [jeckersb@toolbx bootc]$ cargo run -- container compute-composefs-digest localhost/bootc-bin
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.09s
     Running `target/debug/bootc container compute-composefs-digest localhost/bootc-bin`
error: Pulling image: error

After:

⬢ [jeckersb@toolbx bootc]$ cargo run -- container compute-composefs-digest localhost/bootc-bin
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.09s
     Running `target/debug/bootc container compute-composefs-digest localhost/bootc-bin`
error: Pulling image: other error: skopeo proxy unexpectedly exited during request method Initialize: exit status: 125
Error: cannot use command "podman unshare" with the remote podman client

Much more useful. I wasted a fair bit of time running that one down 😭

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
@jeckersb jeckersb changed the title Don't swallow text of Error::Other Don't swallow text from nested errors Nov 20, 2025
@jeckersb
Copy link
Collaborator Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly improves error handling by preventing nested error messages from being swallowed. The changes to the #[error] attributes to include the underlying error details will greatly enhance debuggability. I've included a couple of suggestions to further refine the error messages for the Other variants, making them more direct and less redundant.

/// Conflicting or missing configuration
Configuration(Box<str>),
#[error("error")]
#[error("other error: {0}")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For a general catch-all variant like Other, prefixing the error message with "other error: " can be redundant, as the variant name itself already provides this context. Displaying the wrapped error message directly often leads to cleaner and more precise error reporting.

Suggested change
#[error("other error: {0}")]
#[error("{0}")]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I would rather explicitly know that the error came from the Other variant just so it's easier to know where it might be coming from.

#[error("retryable error: {0}")]
Retryable(Box<str>),
#[error("error")]
#[error("other error: {0}")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the Error::Other variant, prefixing the message with "other error: " is redundant for GetBlobError::Other. Displaying the contained message directly would be cleaner and more direct.

Suggested change
#[error("other error: {0}")]
#[error("{0}")]

Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! This is the real fix for bootc-dev/bootc#1277 (comment)

@cgwalters cgwalters merged commit 67dd086 into bootc-dev:main Nov 20, 2025
2 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