Conversation
A value that does not convert to the property type (for example `Age == "abc"`, `Rating > abc`, or an int overflow) threw FormatException or OverflowException. It now throws ParsingException, with the original exception as the inner exception. BREAKING CHANGE: a bad filter value throws ParsingException, not FormatException or OverflowException. Catch ParsingException or QueryKitException instead. The inner exception keeps the original details.
pdevito3
force-pushed
the
fm/qk-breaking-2x
branch
from
October 1, 2026 21:22
0ed0517 to
fa2dac4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For later consideration in a major version. Do not merge now. This PR is one of three PRs that replace #119. Each PR has one breaking change. The captain decides on each PR separately.
ParsingException.QueryKitParsingException.QueryKitParsingException.What breaks
A filter value that does not convert to the property type throws
ParsingException. On v1.14.2 and main, the same filter throwsFormatExceptionorOverflowException. The original exception is now the inner exception of theParsingException.Old behavior (v1.14.2 and main)
Age == "abc",Age == abc,Rating > abcFormatExceptionAge == 99999999999OverflowExceptionId == "abc",SpecificDateTime == "abc",Favorite == "abc",Age ^^ ["abc"]FormatExceptionNew behavior
Each input in the table throws
ParsingException.ParsingExceptionderives fromQueryKitException. The inner exception is theFormatExceptionor theOverflowException, with its message.Justification
The README says that
QueryKitExceptionis the base class of all QueryKit exceptions, and that a consumer can catch it. On v1.14.2, a bad value escapes this catch. As a result, an API can return a 500 for a client error. After the change, onecatch (QueryKitException)handles every bad filter value.Migration
FormatExceptionorOverflowExceptionfromApplyQueryKitFilterorParseFilter, catchParsingExceptionorQueryKitException.InnerException.Interaction with other PRs
#159 (D4, on main) throws
ParsingExceptionfor a '.' number that the culture can not read. Its testnumber_that_v1_14_2_also_converted_throws_format_exceptionpins the v1.14.2FormatExceptionfor other numbers. This PR renames it tonumber_that_v1_14_2_also_converted_throws_parsing_exceptionand expectsParsingExceptionwith an innerFormatException. The testfailure_before_the_query_name_throws_its_own_format_exception(from #160) changes in the same way.Tests
invalid_value_throws_parsing_exception(9 cases).invalid_value_throws_parsing_exception(4 cases, Postgres).dotnet teston this branch: 479 unit tests and 301 Postgres integration tests (Testcontainers) pass, 0 failures.