fix(operators)!: throw QueryKitParsingException for an unknown logical operator - #164
Merged
Merged
Conversation
pdevito3
force-pushed
the
fm/qk-breaking-logical-operator
branch
from
October 1, 2026 21:23
391733e to
7c93f30
Compare
…l operator LogicalOperator.GetByOperatorString threw System.Exception for an operator that it does not know. It now throws QueryKitParsingException with the same message. QueryKitParsingException derives from QueryKitException. BREAKING CHANGE: an unknown logical operator throws QueryKitParsingException, not System.Exception. Catch QueryKitParsingException or QueryKitException instead.
pdevito3
force-pushed
the
fm/qk-breaking-logical-operator
branch
from
October 2, 2026 19:44
7c93f30 to
fc60eb7
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
The public method
LogicalOperator.GetByOperatorStringthrowsQueryKitParsingExceptionfor an operator that it does not know. On v1.14.2 and main, it throwsSystem.Exception. The message does not change.The filter parser calls this method only with
&&or||, which the grammar reads first. As a result, a filter does not get to this throw. Only code that callsLogicalOperator.GetByOperatorStringdirectly sees the new type.Example
LogicalOperator.GetByOperatorString("xor")Exception: Operator xor is not supportedQueryKitParsingException: Operator xor is not supportedJustification
The README says that
QueryKitExceptionis the base class of all QueryKit exceptions. A plainSystem.Exceptionfrom a public QueryKit method escapes acatch (QueryKitException).QueryKitParsingExceptionderives fromQueryKitException.Migration
If your code calls
LogicalOperator.GetByOperatorStringand catchesExceptionby its exact type, catchQueryKitParsingExceptionorQueryKitException.Tests
unknown_logical_operator_throws_query_kit_parsing_exception.dotnet teston this branch: 471 unit tests and 297 Postgres integration tests (Testcontainers) pass, 0 failures.