Avoid duplicate messages
This commit is contained in:
parent
8a3ddc9c8a
commit
4c84e686d0
1 changed files with 7 additions and 1 deletions
|
@ -300,13 +300,19 @@ namespace Microsoft.DotNet.ProjectModel
|
||||||
private static string ComposeMessageFromInnerExceptions(Exception exception)
|
private static string ComposeMessageFromInnerExceptions(Exception exception)
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
|
var messages = new HashSet<string>();
|
||||||
|
|
||||||
while (exception != null)
|
while (exception != null)
|
||||||
{
|
{
|
||||||
sb.AppendLine(exception.Message);
|
messages.Add(exception.Message);
|
||||||
exception = exception.InnerException;
|
exception = exception.InnerException;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var message in messages)
|
||||||
|
{
|
||||||
|
sb.AppendLine(message);
|
||||||
|
}
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue