File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/Coderr.Client.Tests/Config/ContextCollections Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 3
3
using System . ComponentModel . DataAnnotations ;
4
4
using System . Globalization ;
5
5
using System . Linq ;
6
+ using System . Reflection ;
6
7
using Coderr . Client . ContextCollections ;
7
8
using Coderr . Client . Tests . TestObjects ;
8
9
using FluentAssertions ;
@@ -202,10 +203,17 @@ public void should_be_able_to_serialize_all_types_of_exceptions()
202
203
var sut = new ObjectToContextCollectionConverter ( ) ;
203
204
204
205
var inner = new Exception ( "hello" ) ;
205
- var exceptionTypes =
206
- AppDomain . CurrentDomain . GetAssemblies ( )
206
+ List < Type > exceptionTypes ;
207
+ try
208
+ {
209
+ exceptionTypes = AppDomain . CurrentDomain . GetAssemblies ( )
207
210
. SelectMany ( assembly => assembly . GetTypes ( ) . Where ( y => typeof ( Exception ) . IsAssignableFrom ( y ) ) )
208
211
. ToList ( ) ;
212
+ }
213
+ catch ( ReflectionTypeLoadException ex )
214
+ {
215
+ throw ex . LoaderExceptions [ 0 ] ;
216
+ }
209
217
210
218
foreach ( var exceptionType in exceptionTypes )
211
219
{
You can’t perform that action at this time.
0 commit comments