Skip to content

Conversation

@jessehouwing
Copy link
Contributor

@jessehouwing jessehouwing commented Jan 6, 2026

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 AggregateError instances. 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

  • Added a formatAggregateError function to app/lib/errorhandler.ts to produce user-friendly error messages for AggregateError instances, listing each error with a numbered label.
  • Updated the errLog function to use formatAggregateError, ensuring that when an AggregateError is encountered, its details are logged clearly and consistently.

Extension unsharing robustness

  • Modified the extension unsharing logic in app/exec/extension/unshare.ts to 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

  • Added new tests in tests/errorhandler-tests.ts to verify the formatting and handling of AggregateError and other error types, including edge cases and integration with the error handler.
  • Updated build server integration tests to accept the new formatted output for AggregateError, ensuring consistency with the improved error reporting.

Fixes: #530 part 2

@tarunramsinghani
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tarunramsinghani
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tarunramsinghani tarunramsinghani merged commit 530a655 into microsoft:master Jan 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Packaging Extension from manifest fails on tfx 0.22.6 on Ubuntu 22.04 Azure Agent

3 participants