Skip to content

Customize CTL Error Handling#233

Merged
iamjoemccormick merged 2 commits intomainfrom
iamjoe/feat/customize-ctl-errors
Aug 13, 2025
Merged

Customize CTL Error Handling#233
iamjoemccormick merged 2 commits intomainfrom
iamjoe/feat/customize-ctl-errors

Conversation

@iamjoemccormick
Copy link
Member

What does this PR do / why do we need it?

Required for all PRs.

This PR improves errors when commands exit due to context cancellation. When a command exits due to context cancellation (e.g. Ctrl+C or timeout), display a more explicit message instead of just printing the raw error. This helps users understand that the interruption was intentional or expected, rather than a failure in the tool.

This required updating the MultiError to support unwrapping with errors.Is (which is the error type returned when BeeMsg requests are canceled).

Related Issue(s)

Required when applicable.

Where should the reviewer(s) start reviewing this?

Only required for larger PRs when this may not be immediately obvious.

Are there any specific topics we should discuss before merging?

Not required.

What are the next steps after this PR?

Not required.

Checklist before merging:

Required for all PRs.

When creating a PR these are items to keep in mind that cannot be checked by GitHub actions:

  • Documentation:
    • Does developer documentation (code comments, readme, etc.) need to be added or updated?
    • Does the user documentation need to be expanded or updated for this change?
  • Testing:
    • Does this functionality require changing or adding new unit tests?
    • Does this functionality require changing or adding new integration tests?
  • Git Hygiene:

For more details refer to the Go coding standards and the pull request process.

@iamjoemccormick iamjoemccormick requested a review from swartzn August 5, 2025 21:53
@iamjoemccormick iamjoemccormick self-assigned this Aug 5, 2025
@iamjoemccormick iamjoemccormick marked this pull request as ready for review August 5, 2025 21:53
@iamjoemccormick iamjoemccormick requested a review from a team as a code owner August 5, 2025 21:53
@iamjoemccormick
Copy link
Member Author

Acknowledging this is a bit of a stretch since we're in the soft code freeze, but I realized we are increasingly returning "context canceled" errors when a user cancels a command with ctrl+c (sometimes multiple times if there are multiple goroutines), but that probably doesn't mean anything to most people. This PR adds a quick clarification so people don't get confused.

@iamjoemccormick iamjoemccormick added ux Issues aimed at improving the ease of use, efficiency, and overall user experience. common/types ctl Issues primarily affecting the BeeGFS control tool. labels Aug 5, 2025
@iamjoemccormick iamjoemccormick force-pushed the iamjoe/feat/customize-ctl-errors branch from 3307b4b to 69af7f7 Compare August 6, 2025 19:25
Copy link
Contributor

@swartzn swartzn left a comment

Choose a reason for hiding this comment

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

LGTM!

Add Unwrap support to MultiError to enable use with errors.Is and errors.As. This allows callers to
check for sentinel errors (e.g., context.Canceled) within any of the contained error chains.

A review of existing MultiError usage shows this change should not introduce undesirable behavior or
alter current error handling semantics.
When a command exits due to context cancellation (e.g. Ctrl+C or timeout), display a more explicit
message instead of just printing the raw error. This helps users understand that the interruption
was intentional or expected, rather than a failure in the tool.
@iamjoemccormick iamjoemccormick force-pushed the iamjoe/feat/customize-ctl-errors branch from 69af7f7 to 95b7155 Compare August 12, 2025 15:44
@iamjoemccormick iamjoemccormick merged commit 5113377 into main Aug 13, 2025
6 checks passed
@iamjoemccormick iamjoemccormick deleted the iamjoe/feat/customize-ctl-errors branch August 13, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common/types ctl Issues primarily affecting the BeeGFS control tool. ux Issues aimed at improving the ease of use, efficiency, and overall user experience.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants