Skip to content

Commit

Permalink
Add FormatException case to Utf8ToString() catch
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin committed Dec 18, 2024
1 parent 76bb2da commit 99d2076
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,10 @@ public override int GetOrd(int docId)
SimpleTextUtil.ReadLine(_input, _scratch);
try
{
// LUCNENENET: .NET doesn't have a way to specify a pattern with integer, but all of the standard ones are built in.
// LUCENENET: .NET doesn't have a way to specify a pattern with integer, but all of the standard ones are built in.
return int.Parse(_scratch.Utf8ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture) - 1;
}
catch (Exception pe) when (pe.IsParseException())
catch (Exception pe) when (pe.IsParseException() || pe.IsNumberFormatException())
{
var e = new CorruptIndexException($"failed to parse ord (resource={_input})", pe);
throw e;
Expand Down

0 comments on commit 99d2076

Please sign in to comment.