We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4bb681b commit 54e0155Copy full SHA for 54e0155
1 file changed
DataStructures/Common/PrimesList.cs
@@ -76,9 +76,16 @@ private static void _initializeData()
76
77
if (numbersAsStrings.Count > 0)
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);
+ try
+ {
+ // 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
89
}
90
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
0 commit comments