-
Notifications
You must be signed in to change notification settings - Fork 838
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
DocumentDb Exception failed to be deserialized #881
Comments
Could you share what is the code that is facing this error? Any way to reproduce? |
Sure code snippet(), but i was able to reproduce the issue with this by trying to force an exception
Any way to reproduce
|
And you are just throwing the error to the caller and expect it to JSON serialize and the caller makes sense of it? How would the caller know what a DocumentClientException is? |
Describe the bug
I encountered an exception while using azure document client to work with cosmos db. but when i should have received a normal document client exception i receive
"Failed to deserialize exception from TaskActivity: {"$type":"Microsoft.Azure.Documents.DocumentClientException, Microsoft.Azure.DocumentDB.Core","Error":{"$type":"Microsoft.Azure.Documents.Error, Microsoft.Azure.DocumentDB.Core","code":"Conflict","message":"Message: {\"Errors\":[\"Resource with specified id, name, or unique index already exists.\"]}\r\nActivityId: 8f407976-9ac5-4cb2-87b0-b63b47106608, Request URI: /apps/DocDbApp/services/DocDbMaster0/partitions/780e44f4-38c8-11e6-8106-8cdcd42c33be/replicas/1p/, RequestStats: , SDK: Microsoft.Azure.Documents.Common/2.14.0","_ts":0},
with the root cause beingNewtonsoft.Json.JsonSerializationException: Unable to find a constructor to use for type Microsoft.Azure.Documents.DocumentClientException. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute
To Reproduce
Expected behavior
Actual behavior
Environment summary
SDK Version:
OS Version (e.g. Windows, Linux, MacOSX):
Additional context
The text was updated successfully, but these errors were encountered: