[CSHARP-1192] Wrap exceptions that occur during communication with a MongoCommunicationException Created: 13/Mar/15 Updated: 02/Apr/15 Resolved: 13/Mar/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | None |
| Fix Version/s: | 2.0 |
| Type: | Task | Priority: | Major - P3 |
| 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: | Major Change |
| Description |
|
Wrap any exceptions that occur during communications in a MongoCommunicationException. Except: any subclasses of SystemException. These exceptions are all runtime errors that aren't meant to be caught because there is usually nothing you can do about them. This is backward breaking to any applications that are catching the unwrapped exceptions. They will now need to catch MongoConnectionException and examine the inner exception. |
| Comments |
| Comment by Githook User [ 20/Mar/15 ] |
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: |
| Comment by Robert Stam [ 17/Mar/15 ] |
|
We ended up wrapping all exceptions instead of excluding SystemException and its subclasses. The main reason is that SocketException is a subclass of SystemException, and we definitely want to wrap SocketException. The second reason is that it is just too hard to come up with a comprehensive and accurate list of what to wrap and what not to wrap. It's just easier to wrap everything. |
| Comment by Githook User [ 13/Mar/15 ] |
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: |
| Comment by Githook User [ 13/Mar/15 ] |
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: |