-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query: Fixes invalid query text exception losing error details #3137
Merged
Conversation
This file contains 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
ealsur
requested review from
khdang,
sboshra,
neildsh,
kirankumarkolli,
j82w,
FabianMeiswinkel,
kirillg and
leminh98
as code owners
April 8, 2022 22:49
j82w
previously approved these changes
Apr 9, 2022
j82w
reviewed
Apr 9, 2022
Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanRetriever.cs
Outdated
Show resolved
Hide resolved
j82w
reviewed
Apr 11, 2022
...latorTests/BaselineTest/TestBaseline/LinqAggregateFunctionBaselineTests.TestAggregateAvg.xml
Show resolved
Hide resolved
j82w
previously approved these changes
Apr 11, 2022
Great PR description Matias! |
neildsh
reviewed
Apr 11, 2022
neildsh
reviewed
Apr 11, 2022
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanRetrieverTests.cs
Outdated
Show resolved
Hide resolved
neildsh
reviewed
Apr 11, 2022
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs
Show resolved
Hide resolved
neildsh
previously approved these changes
Apr 11, 2022
j82w
approved these changes
Apr 11, 2022
j82w
pushed a commit
that referenced
this pull request
May 5, 2022
* Fixing the exception * Throw right one * Right stack trace * tests * Changing to message * Updating contract baselines * Adding new test * Updating output generation * variable name
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.
Pull Request Template
Description
When the SDK is on Direct mode, the SDK attempts to generate the query plan locally (see https://docs.microsoft.com/en-us/azure/cosmos-db/sql/performance-tips-query-sdk?tabs=v3&pivots=programming-language-csharp#use-local-query-plan-generation). If it detects that the query is malformed, it returns a Bad Request (HTTP 400) exception.
The problem was that the code was using Monads and throwing the Monad exception, leaving the InnerException
null
and adding a lot of Monad related information to the exception Message that was irrelevant to the users, making the discovery of the actual parsing error very difficult.The PR maintains the Stack Trace and Diagnostics, and adds the InnerException pointing to the real error, and reduces the clutter on the Message.
Original exception
Message
InnerException
null
StackTrace
Diagnostics
Exception after this PR
Message
InnerException
StackTrace
Diagnostics
Type of change
Closing issues
Closes #1910
Closes #2847