Comments (5)
Thanks @mkolt - this is great.
Per my original request though, I don't think this issue should be closed until this information has been added to the docs. I just tried googling "Cosmos DB SubStatusCode errorCode" and can't find anything in the docs about this. Actually, one of the first results to come up is this user voice.
from azure-cosmos-dotnet-v3.
@kentcb can you please sent a mail to askcosmosdb[AT]microsoft.com? I will compile and put the summary on this thread.
from azure-cosmos-dotnet-v3.
From inside sproc you can throw new Error(errorCode, "Error message"), where errorCode is a number (short int) like 1234. On client side you can get this code from DocumentClientException as SubStatusCode which can be obtained from DocumentClientException.ResponseHeaders (e.g. see how to get it).
from azure-cosmos-dotnet-v3.
What's the status on this? I am unable to find any official information on the "x-ms-substatus" HTTP response header. I've been using Cosmos DB for some time now and am starting to write SPROCs using typescript (async/await for the win), and with that quickly came the requirement of relaying different error codes back to the caller.
from azure-cosmos-dotnet-v3.
I agree. This is poor or forced design. Error codes within errors throws from sprocs cause always a BadRequestException without any data except a cosmosError added by force to suck Exception and the internal sub error codes. I think the container client should parse the error codes, not the user
from azure-cosmos-dotnet-v3.
Related Issues (20)
- Money maker HOT 2
- ChangeFeedProcessor: AVAD Response to Include More Intrinsic Information (specifically Feed Range) and API to validate processed LSNs
- Microsoft.Azure.Cosmos copies older vcruntime140 DLLs, creating risk of ABI breaks + crashes HOT 2
- LINQ custom serializer: query translated incorrectly when passing variable to the nested "where" clause HOT 4
- COUNT is including expired TTL documents that are pending deletion HOT 3
- Make the `VectorIndexes` setter as `internal` in `IndexingPolicy`
- TcpOpenConnectionTimeout TimeSpan contract not honoring values less than a second
- What is the stream needed for or how is it used in `PatchItemStreamAsync`? HOT 2
- Microsoft.Azure.Cosmos.Encryption.Custom 1.0.0-preview06 is incompatible with Cosmos 3.40.0-preview.0 and newer
- Change Feed / Processor: AVAD timeToLiveExpired deserialization Issue
- LINQ support for specifying FilterPredicate
- Clarification on versioning practices of preview packages HOT 1
- Session-level consistency across multiple SDK clients/across different processes HOT 2
- Add New Zealand North region in Public Contract
- CosmosClientOptions.Request is not respected.
- TelemetrySpan is not failures are not reflected in-case of non-exceptions
- Benchmark using not releasing
- invalid syntax for GetDatabase - closing paren is shown as closing square bracket HOT 1
- ReadManyItemsAsync -> ReadManyTaskHelperAsync wraps forked IO task into Task.Run
- AggregateException (instead of CosmosException) being thrown on GetFeedRanges when Gateway fails HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-cosmos-dotnet-v3.