Skip to content

Commit fc620a3

Browse files
epsitecstephentoubdanmoseley
authored
Fix comments in AggregateException.GetBaseException() (#107743)
* Fix comments in AggregateException.GetBaseException() The public <summary> incorrectly stated that the method returned an AggregateException. * Update src/libraries/System.Private.CoreLib/src/System/AggregateException.cs Co-authored-by: Stephen Toub <[email protected]> * Extract GetBaseException() <summary> content to <remarks> * Update src/libraries/System.Private.CoreLib/src/System/AggregateException.cs --------- Co-authored-by: Stephen Toub <[email protected]> Co-authored-by: Dan Moseley <[email protected]>
1 parent cf03276 commit fc620a3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/libraries/System.Private.CoreLib/src/System/AggregateException.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,16 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont
213213
}
214214

215215
/// <summary>
216-
/// Returns the <see cref="AggregateException"/> that is the root cause of this exception.
216+
/// Returns the <see cref="Exception"/> that is the root cause of this exception.
217217
/// </summary>
218+
/// <remarks>
219+
/// This will either be the root exception, or the first <see cref="AggregateException"/>
220+
/// that contains either multiple inner exceptions or no inner exceptions at all.
221+
/// </remarks>
218222
public override Exception GetBaseException()
219223
{
220-
// Returns the first inner AggregateException that contains more or less than one inner exception
221-
222-
// Recursively traverse the inner exceptions as long as the inner exception of type AggregateException and has only one inner exception
224+
// Recursively traverse the inner exceptions as long as the inner exception is of type
225+
// AggregateException and has exactly one inner exception
223226
Exception? back = this;
224227
AggregateException? backAsAggregate = this;
225228
while (backAsAggregate != null && backAsAggregate.InnerExceptions.Count == 1)

0 commit comments

Comments
 (0)