[CSHARP-351] Better error message when document being deserialized doesn't match class declaration Created: 03/Nov/11 Updated: 02/Apr/15 Resolved: 04/Nov/11 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.3 |
| Fix Version/s: | 1.3.1 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Minor Change |
| Description |
|
Given the following classes: public class C { public int _id; public N n; }public class N { public int x; }the following code results in an InvalidOperationException: var json = " { '_id' : 1, n : 'should be a document, not a string' }"; The error message should be more specific, identifying which property of which class couldn't be deserialized. |
| Comments |
| Comment by auto [ 16/Jul/12 ] |
|
Author: {u'date': u'2012-07-16T05:59:09-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: |
| Comment by Robert Stam [ 04/Nov/11 ] |
|
When the BsonClassMapSerializer encounters an error deserializing a field or property the name of the field or property as well as the name of the class they are in are included in the error message to assist the user in troubleshooting the problem. Backward breaking in the sense that the type of the exception thrown is sometimes different. |