Repository navigation
Surface nested aggregate exception details - #2307
Draft
rksharma-owg wants to merge 2 commits into
Draft
rksharma-owg wants to merge 2 commits into
rksharma-owg wants to merge 2 commits into
Conversation
rksharma-owg
force-pushed
the
codex/2112-preserve-aggregate-exceptions
branch
from
August 30, 2026 15:52
93a2f47 to
18f362c
Compare
Author
|
Refreshed this branch onto current The three previous attached check suites were not code/test failures: they contained zero jobs and automatically expired after waiting 30 days for first-time-contributor workflow approval. The same contribution SHA had already passed all seven jobs in fork CI, including PSScriptAnalyzer and Windows PowerShell Pester. Fresh upstream runs were created by this update and currently show |
rksharma-owg
force-pushed
the
codex/2112-preserve-aggregate-exceptions
branch
from
September 30, 2026 03:24
18f362c to
3841939
Compare
This branch has not been deployed
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.
🗣 Description
Get-FullExceptionDetailsas a shared utility for preserving every nestedAggregateExceptionmessage and the script stack trace.Connect-TenantandCommandTracker.TryCommandwarnings and structured log data.💭 Motivation and context
Problem
The affected catch blocks only read the top-level
Exception.Message. When an asynchronous cmdlet throws anAggregateException, the actionable provider or authentication error can remain nested, leaving users with a generic diagnostic such asOne or more errors occurred.Root cause
Neither catch block traversed the aggregate exception tree before formatting its console warning or log data.
Solution
The new utility collects the top-level message, walks all aggregate branches and nested inner exceptions in deterministic breadth-first order, and returns that message set with the existing script stack trace. Non-aggregate exception formatting remains unchanged. The connection and provider paths now share this implementation instead of duplicating exception traversal.
The original wrong-Teams-AppId reproduction no longer reaches this path after #2342. The current regression tests instead inject an
AggregateExceptionat the present authentication/provider boundaries and assert the nested message appears as its own warning line.Resolves #2112.
🧪 Testing
Exact patch:
8d9b4bf999147769dfef34b2a62ffee8f1f875d8Current baseline:
6018b15178ae7dd51edcc7b1e6608a2d4411f41dLocal environment: macOS 27.0 (arm64), PowerShell 7.6.6, Pester 5.7.1, PSScriptAnalyzer 1.25.0.
git diff --checkagainst currentmain: passed.The branch includes current
main, which contains the accepted version-fixture repair from #2446 and the upstream Regal pin. This PR adds no unrelated test-fixture or workflow changes. Local extended version tests encountered five WindowsPrincipal platform failures on macOS; those tests passed in the complete hosted Windows suites. Upstream-only approval, smoke, and tenant-functional checks are not claimed as passed.Risk
✅ Pre-approval checklist
main) for merge.✅ Pre-merge checklist
✅ Post-merge checklist