diff options
author | Jan Kotas <jkotas@microsoft.com> | 2016-01-14 06:58:48 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-01-14 06:58:48 +0300 |
commit | 6532e4708effb2d32891df1179312fac7a8afeb4 (patch) | |
tree | 2634ea304ba607bf79e3e22bef12f8a4a0cc9b07 | |
parent | 811a3232872e0ac3835b932c0ebbb7a130c11623 (diff) | |
parent | 3122f026a87dae2f424818f20b796a7893e6c250 (diff) |
Merge pull request #646 from stephentoub/port_2642v0.0.1
Port https://github.com/dotnet/coreclr/pull/2642 to CoreRT
-rw-r--r-- | src/System.Private.Threading/src/System/AggregateException.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/System.Private.Threading/src/System/AggregateException.cs b/src/System.Private.Threading/src/System/AggregateException.cs index a0700b351..fb644e7a4 100644 --- a/src/System.Private.Threading/src/System/AggregateException.cs +++ b/src/System.Private.Threading/src/System/AggregateException.cs @@ -379,6 +379,30 @@ namespace System return new AggregateException(Message, flattenedExceptions); } + /// <summary>Gets a message that describes the exception.</summary> + public override string Message + { + get + { + if (m_innerExceptions.Count == 0) + { + return base.Message; + } + + StringBuilder sb = new StringBuilder(); + sb.Append(base.Message); + sb.Append(' '); + for (int i = 0; i < m_innerExceptions.Count; i++) + { + sb.Append('('); + sb.Append(m_innerExceptions[i].Message); + sb.Append(") "); + } + sb.Length -= 1; + return sb.ToString(); + } + } + /// <summary> /// Creates and returns a string representation of the current <see cref="AggregateException"/>. /// </summary> |