Open deadshot465 opened 2 years ago
We can certainly do a better job showing nice error messages, but I'll address the direct issue. You are likely getting a 400 due to trying to query across continuations. I believe this is due to the use of "max" in your query. I'm not familiar enough with Cosmos DBs querying engine to know what the work around is here.
I could not find out how other SDKs are currently handling this, but perhaps @heaths has some insight.
By design, we try to avoid extra client-side validation and, by extension, assumption of error causes unless obvious. Thus, we pass the service errors straight through. Perhaps improving the error e.g., making it actionable, is best done by the service themselves.
@heaths interestingly the error message says that this should be handled by the client:
This is a first chance (internal) exception that all newer clients will know how to handle gracefully. This exception is traced, but unless you see it bubble up as an exception (which only happens on older SDK clients)
Do you know what that refers to?
I didn't see that in the error above, but it is in the page linked (which shouldn't refer to the "en-us" locale, but that's an entirely different issue). I don't know anything about the Cosmos service.
Adding codeowners from the Azure SDK for .NET repo: @pjohari-ms @MehaKaushik @shurd @anfeldma-ms @zfoster @kushagraThapar
Can anyone shed some light on what this error means and if/how we should better represent it? Ideally, behavior here should match what we do in other languages for Azure SDK but I have no insight into the Cosmos DB SDK.
So I was trying to do this yesterday:
The request failed and the logs only showed
But the query worked fine in Azure portal when I created a new SQL query against the container. I tried searching in the docs, but I couldn't seem to find other functions that accept queries. Digging in Microsoft docs, I also found this here:
But the logs showed that the endpoint being requested was
https://<my-db-account>.documents.azure.com/dbs/<my-db-name>/colls/Users/docs
, which doesn't seem to be the right endpoint?It led me to think if the 400 Bad Request was caused by this:
Is it a bug, or the library currently doesn't support using aggregate functions in queries, or I'm calling an incorrect function?