Skip to content

cmd: colored error message in WrapCommandFuncForCobra (#7760)#7768

Open
u5surf wants to merge 3 commits into
caddyserver:masterfrom
u5surf:issue-7760
Open

cmd: colored error message in WrapCommandFuncForCobra (#7760)#7768
u5surf wants to merge 3 commits into
caddyserver:masterfrom
u5surf:issue-7760

Conversation

@u5surf
Copy link
Copy Markdown
Contributor

@u5surf u5surf commented May 25, 2026

Assistance Disclosure

I consulted Claude code for the issue, but I coded it myself because it is easy to fix, but Claude helped me to generate some code comments.

Fixes: #7760

WrapCommandFuncForCobra has not colored error messages. So We should wrap error messages with caddy.Log().Error.

@francislavoie francislavoie added the feature ⚙️ New feature or request label Jun 4, 2026
@francislavoie francislavoie added this to the v2.11.5 milestone Jun 4, 2026
@francislavoie
Copy link
Copy Markdown
Member

I think this is probably fine but it does sorta mean the error message is a bit less machine readable since it's not just plain text on the final line, but I think that's probably not a big deal.

Do you mind taking a screenshot of how it looks for you before and after? Thanks!

@u5surf
Copy link
Copy Markdown
Contributor Author

u5surf commented Jun 5, 2026

@francislavoie

Do you mind taking a screenshot of how it looks for you before and after?

I took screenshots to compare before to after.
before:
before
after:
after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature ⚙️ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: Make caddy validate -c errors more prominent

3 participants