Skip to content

Commit 54e0155

Browse files
committed
Test commit to see the text line that causes the exception to be raised.
1 parent 4bb681b commit 54e0155

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

DataStructures/Common/PrimesList.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)