Skip to content

fix: suppress printing the newline when a status error has no output - #7543

Merged
thaJeztah merged 1 commit into
docker:masterfrom
jsternberg:cli-error-newline-suppress
Nov 24, 2026
Merged

thaJeztah merged 1 commit into
docker:masterfrom
jsternberg:cli-error-newline-suppress

Conversation

@jsternberg

Copy link
Copy Markdown
Contributor

Summary

When a cli.StatusError was returned by a plugin, the error would be printed with Fprintln even if the message was empty. This avoids the call entirely if cli.StatusError is returned and the error text is empty to allow plugins to return non-zero exit statuses without printing anything.

Related to docker/compose#14382.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli-plugins/plugin/plugin.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@vvoland vvoland added this to the 29.11.0 milestone Nov 24, 2026
@vvoland vvoland added kind/bugfix PR's that fix bugs area/ux labels Nov 24, 2026
@vvoland

vvoland commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Oh, can you fix the signoff?

When a `cli.StatusError` was returned by a plugin, the error would be
printed with `Fprintln` even if the message was empty. This avoids the
call entirely if `cli.StatusError` is returned and the error text is
empty to allow plugins to return non-zero exit statuses without printing
anything.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
@jsternberg
jsternberg force-pushed the cli-error-newline-suppress branch from 34ef118 to b0a3c17 Compare November 24, 2026 16:37
@jsternberg

Copy link
Copy Markdown
Contributor Author

Fixed the signoff.

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
thaJeztah merged commit db95b60 into docker:master Nov 24, 2026
99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ux kind/bugfix PR's that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants