Merged
Conversation
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 |
3307b4b to
69af7f7
Compare
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.
69af7f7 to
95b7155
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
For more details refer to the Go coding standards and the pull request process.