File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -76,9 +76,16 @@ private static void _initializeData()
7676
7777 if ( numbersAsStrings . Count > 0 )
7878 {
79- // cast them into integers and add them to the primes list
80- var numbers = numbersAsStrings . Select ( item => Convert . ToInt32 ( item ) ) . ToList < int > ( ) ;
81- _primes . AddRange ( numbers ) ;
79+ try
80+ {
81+ // cast them into integers and add them to the primes list
82+ var numbers = numbersAsStrings . Select ( item => Convert . ToInt32 ( item ) ) . ToList < int > ( ) ;
83+ _primes . AddRange ( numbers ) ;
84+ }
85+ catch ( Exception e )
86+ {
87+ throw new Exception ( line , e ) ;
88+ }
8289 }
8390 }
8491 }
@@ -225,7 +232,5 @@ private static string[] _readResource(string resourceName)
225232 throw new Exception ( $ "Failed to read resource { resourceName } ", ex ) ;
226233 }
227234 }
228-
229- }
230-
235+ }
231236}
You can’t perform that action at this time.
0 commit comments