Skip to content

Commit 79a58db

Browse files
committed
- v10.0.10
1 parent f71daf2 commit 79a58db

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

Shuttle.Core.Reflection/ExceptionExtensions.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Text;
43
using Shuttle.Core.Contract;
54

65
namespace Shuttle.Core.Reflection
76
{
87
public static class ExceptionExtensions
98
{
9+
public static T Find<T>(this Exception ex) where T : Exception
10+
{
11+
var enumerator = ex;
12+
13+
while (enumerator != null)
14+
{
15+
if (enumerator is T result)
16+
{
17+
return result;
18+
}
19+
20+
enumerator = enumerator.InnerException;
21+
}
22+
23+
return null;
24+
}
25+
26+
public static bool Contains<T>(this Exception ex) where T : Exception
27+
{
28+
return ex.Find<T>() != null;
29+
}
30+
1031
public static string AllMessages(this Exception ex)
1132
{
1233
var messages = new StringBuilder();

Shuttle.Core.Reflection/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
[assembly: AssemblyTitle(".NET Standard 2.0")]
3434
#endif
3535

36-
[assembly: AssemblyVersion("10.0.9.0")]
36+
[assembly: AssemblyVersion("10.0.10.0")]
3737
[assembly: AssemblyCopyright("Copyright © Eben Roux 2017")]
3838
[assembly: AssemblyProduct("Shuttle.Core.Reflection")]
3939
[assembly: AssemblyCompany("Shuttle")]
4040
[assembly: AssemblyConfiguration("Release")]
41-
[assembly: AssemblyInformationalVersion("10.0.9")]
41+
[assembly: AssemblyInformationalVersion("10.0.10")]
4242
[assembly: ComVisible(false)]

0 commit comments

Comments
 (0)