Enhance error handling with AggregateError formatting #532
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.
Improve error handling by adding formatting for AggregateError, allowing clearer output of multiple errors. Update tests to reflect this new error format.
This pull request improves error handling for extension unsharing operations, specifically by enhancing the formatting and reporting of
AggregateErrorinstances. It introduces a new utility to format multiple errors in a readable way, updates the code to use this formatting when handling errors from asynchronous operations, and adds comprehensive tests to ensure correct behavior for various error scenarios.Error handling improvements
formatAggregateErrorfunction toapp/lib/errorhandler.tsto produce user-friendly error messages forAggregateErrorinstances, listing each error with a numbered label.errLogfunction to useformatAggregateError, ensuring that when anAggregateErroris encountered, its details are logged clearly and consistently.Extension unsharing robustness
app/exec/extension/unshare.tsto catch and handle errors from each unshare operation using the improved error handler, preventing unhandled promise rejections and ensuring errors are reported properly. [1] [2]Test coverage enhancements
tests/errorhandler-tests.tsto verify the formatting and handling ofAggregateErrorand other error types, including edge cases and integration with the error handler.AggregateError, ensuring consistency with the improved error reporting.Fixes: #530 part 2