[CSHARP-689] Incorrect error message from ObjectId.Unpack() Created: 21/Feb/13 Updated: 20/Mar/14 Resolved: 25/Feb/13 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.7.1 |
| Fix Version/s: | 1.8 |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | Daniel Sinclair | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows |
||
| Issue Links: |
|
||||||||
| Description |
|
The new ArgumentOutOfRangeException() is incorrectly formed. It's passing a message as the parameter name. It should read; throw new ArgumentOutOfRangeException("bytes", "Byte array must be 12 bytes long."); Ideally though, it would have a bit more information relating to ObjectId. |
| Comments |
| Comment by auto [ 25/Feb/13 ] |
|
Author: {u'date': u'2013-02-22T15:59:26Z', u'name': u'rstam', u'email': u'robert@10gen.com'}Message: |
| Comment by Robert Stam [ 22/Feb/13 ] |
|
A related question is whether ArgumentOutOfRangeException is the appropriate exception. In this particular case ArgumentException is probably more appropriate, because there is no numeric range involved. We will be reviewing exceptions more thoroughly for 2.0. See |