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()
76
76
77
77
if ( numbersAsStrings . Count > 0 )
78
78
{
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
+ }
82
89
}
83
90
}
84
91
}
@@ -225,7 +232,5 @@ private static string[] _readResource(string resourceName)
225
232
throw new Exception ( $ "Failed to read resource { resourceName } ", ex ) ;
226
233
}
227
234
}
228
-
229
- }
230
-
235
+ }
231
236
}
You can’t perform that action at this time.
0 commit comments