3 changed files with 26 additions and 2 deletions
@ -0,0 +1,23 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Avalonia.Utilities |
||||
|
{ |
||||
|
internal static class ExceptionUtilities |
||||
|
{ |
||||
|
public static string GetMessage(Exception e) |
||||
|
{ |
||||
|
var aggregate = e as AggregateException; |
||||
|
|
||||
|
if (aggregate != null) |
||||
|
{ |
||||
|
return string.Join(" | ", aggregate.InnerExceptions.Select(x => x.Message)); |
||||
|
} |
||||
|
|
||||
|
return e.Message; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue