Skip to content
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

add more edge cases to Query Error parser #2003

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

analogrelay
Copy link
Member

@analogrelay analogrelay commented Oct 29, 2024

Preview this branch

The backend has shifted how errors are reported a bit. Now, when we get detailed query errors from newer backends, we get a payload that looks like this:

{
    "code": "BadRequest",
    "message": "{\"code\":\"BadRequest\",\"message\":\"{\\\"errors\\\":[{\\\"severity\\\":\\\"Error\\\",\\\"location\\\":{\\\"start\\\":7,\\\"end\\\":18},\\\"code\\\":\\\"SC2005\\\",\\\"message\\\":\\\"'nonexistent' is not a recognized built-in function name.\\\"}]}\\r\\nActivityId: f9ef6130-d878-4eb9-89c9-1f525782b6c4, Windows/10.0.20348 cosmos-netstandard-sdk/3.18.0\"}"
}

Our current parsing doesn't support this (it's basically added another layer of JSON wrapping the error), so I've added support for it.

NOTE: I'm still working with the query team to get this into a format that doesn't require quite so many hacks to parse, but until then, we kinda have to just chase the weird formatting a bit. I was expecting a change like this to come, and am not expecting another change in format (until, hopefully, we can get errors reported as a top-level JSON property).

@analogrelay analogrelay marked this pull request as ready for review October 29, 2024 19:53
@analogrelay analogrelay requested a review from a team as a code owner October 29, 2024 19:53
@analogrelay analogrelay merged commit 056be2a into master Oct 30, 2024
20 checks passed
@analogrelay analogrelay deleted the ashleyst/fix-error-format branch October 30, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants