Skip to content

Commit

Permalink
Lucene.Net.QueryParser.Flexible.Standard.Processors: Changed numeric …
Browse files Browse the repository at this point in the history
…processors back to using FormatException, because that is the expected parse error in .NET (see #446)
  • Loading branch information
NightOwl888 committed Apr 26, 2021
1 parent f7eac9d commit 2b278b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected override IQueryNode PostProcessNode(IQueryNode node)
{
number = numberFormat.Parse(text);
}
catch (Exception e) when (e.IsParseException())
catch (FormatException e) // LUCENENET: In .NET we are expecting the framework to throw FormatException, not ParseException
{
throw new QueryNodeParseException(new Message(
QueryParserMessages.COULD_NOT_PARSE_NUMBER, fieldNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected override IQueryNode PostProcessNode(IQueryNode node)
{
lowerNumber = numberFormat.Parse(lowerText);
}
catch (Exception e) when (e.IsParseException())
catch (FormatException e) // LUCENENET: In .NET we are expecting the framework to throw FormatException, not ParseException
{
throw new QueryNodeParseException(new Message(
QueryParserMessages.COULD_NOT_PARSE_NUMBER, lower
Expand All @@ -101,7 +101,7 @@ protected override IQueryNode PostProcessNode(IQueryNode node)
{
upperNumber = numberFormat.Parse(upperText);
}
catch (Exception e) when (e.IsParseException())
catch (FormatException e) // LUCENENET: In .NET we are expecting the framework to throw FormatException, not ParseException
{
throw new QueryNodeParseException(new Message(
QueryParserMessages.COULD_NOT_PARSE_NUMBER, upper
Expand Down

0 comments on commit 2b278b3

Please sign in to comment.