Skip to content

Conversation

@majiayu000
Copy link
Contributor

Summary

This PR fixes #3048

Changes

  • cmd/thv/app/group.go
  • cmd/thv/app/restart.go
  • cmd/thv/app/rm.go
  • cmd/thv/app/stop.go

Improve user experience by adding actionable hints to error messages
in rm, stop, restart, and group commands. Each error message now
includes a "Hint:" suffix that guides users on how to resolve the issue.

Error scenarios updated:
- rm/stop: flags conflict with workload names
- rm/stop: missing workload name argument
- rm/stop/restart: group does not exist
- restart: flags conflict with workload name
- restart: missing workload specification
- group: cannot delete default group
- group rm: group does not exist
- group run: registry group not found
- group run: runtime group already exists
- group run: MCP server already exists

Fixes stacklok#3048

Signed-off-by: majiayu000 <1835304752@qq.com>
Copy link
Member

@eleftherias eleftherias left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @majiayu000. I've left a comment below about a hint that recommends a command that does not exist.

@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Jan 13, 2026
@eleftherias eleftherias changed the title fix: Improve error messages with actionable recovery hints Improve error messages with actionable recovery hints Jan 13, 2026
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Jan 13, 2026
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.63%. Comparing base (3d3782c) to head (95301d2).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3165   +/-   ##
=======================================
  Coverage   63.63%   63.63%           
=======================================
  Files         357      357           
  Lines       35156    35156           
=======================================
  Hits        22373    22373           
  Misses      10979    10979           
  Partials     1804     1804           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eleftherias eleftherias merged commit 77ec937 into stacklok:main Jan 13, 2026
28 checks passed
@eleftherias
Copy link
Member

Thanks for the PR @majiayu000! I made a small change and merged this.

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

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error messages with actionable recovery hints

4 participants